Allow passing attributes to Pithub instance helpers
schwern opened this issue · comments
Michael G. Schwern commented
Sometimes it's useful to change an attribute just for one call. But the instance helpers don't take arguments, so you have to do it in two steps.
sub has_commits {
...
my $commits = $p->repos->commits;
$commits->per_page(1);
return $commits->count;
}
If _create_instance
took arguments it could use them to override the ones passed on from the parent object.
sub has_commits {
...
return $p->repos->commits( per_page => 1 )->count;
}
Michael G. Schwern commented
Done by #170