Created
June 28, 2010 18:31
-
-
Save schwern/456188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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