Skip to content

Instantly share code, notes, and snippets.

@schwern
Created June 28, 2010 18:31
Show Gist options
  • Select an option

  • Save schwern/456188 to your computer and use it in GitHub Desktop.

Select an option

Save schwern/456188 to your computer and use it in GitHub Desktop.
# So my $github = $obj->github({ arg => "foo" }) works;
has github =>
isa => "Gitpan::Github|HashRef",
is => 'rw',
lazy => 1,
trigger => sub { # trigger doesn't take a method
my($self, $new, $old) = @_;
return $new if $new->isa("Gitpan::Github");
$self->github( $self->_new_github($new) );
},
default => method {
return $self->_new_github;
};
method _new_github(HashRef $args = {}) {
return Gitpan::Github->new(
repo => $self->distname,
%$args,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment