Created
February 10, 2011 16:10
-
-
Save Getty/820790 to your computer and use it in GitHub Desktop.
Sugar::Cane working
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
| package Sugar::Cane; | |
| # ABSTRACT: EXPERIMENTAL What you need to produce Sugar | |
| use Moose (); | |
| use Moose::Exporter; | |
| use Moose::Util; | |
| my ( $import, $unimport, $init_meta ) = Moose::Exporter->setup_import_methods( | |
| with_meta => [ 'attributes' ] | |
| ); | |
| sub import { | |
| my $sugar_class = caller; | |
| Moose::Exporter->setup_import_methods( | |
| exporting_package => $sugar_class, | |
| class_metaroles => { | |
| class => [ 'Sugar::Cane::Meta::Trait::Class' ], | |
| }, | |
| also => [ 'Moose' ], | |
| ); | |
| goto $import; | |
| } | |
| sub attributes { | |
| my ( $meta, %args ) = @_; | |
| $meta->sugar_default_attributes(\%args); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment