Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jjn1056/220171 to your computer and use it in GitHub Desktop.
Save jjn1056/220171 to your computer and use it in GitHub Desktop.
use MooseX::Declare;
class MyApp::Library {
use MyApp::Album;
use MooseX::Types::Moose qw(HashRef ClassName);
has album_class => (
is => 'ro',
isa => ClassName,
required =>1,
default => 'MyApp::Album',
handles => {
create_sample_album => 'new',
},
);
has album => (
is => 'ro',
isa => 'MyApp::Album',
init_arg => undef,
lazy_build => 1,
);
has album_args => (
is => 'ro',
isa => HashRef,
required => 1,
);
method _build_album {
$self->create_album($self->args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment