package MooseX::Declare::Syntax::Extending; BEGIN { $MooseX::Declare::Syntax::Extending::AUTHORITY = 'cpan:FLORA'; } { $MooseX::Declare::Syntax::Extending::VERSION = '0.35'; } # ABSTRACT: Extending with superclasses use Moose::Role; use aliased 'MooseX::Declare::Context::Namespaced'; use namespace::clean -except => 'meta'; with qw( MooseX::Declare::Syntax::OptionHandling ); around context_traits => sub { shift->(@_), Namespaced }; sub add_extends_option_customizations { my ($self, $ctx, $package, $superclasses) = @_; # add code for extends keyword $ctx->add_scope_code_parts( sprintf 'extends %s', join ', ', map { "'$_'" } map { $ctx->qualify_namespace($_) } @{ $superclasses }, ); return 1; } 1; __END__ =pod =encoding utf-8 =head1 NAME MooseX::Declare::Syntax::Extending - Extending with superclasses =head1 DESCRIPTION Extends a class by a specified C option. =head1 METHODS =head2 add_extends_option_customizations Object->add_extends_option_customizations ( Object $ctx, Str $package, ArrayRef $superclasses, HashRef $options ) This will add a code part that will call C with the C<$superclasses> as arguments. =head1 CONSUMES =over 4 =item * L =back =head1 SEE ALSO =over 4 =item * L =item * L =item * L =back =head1 AUTHORS =over 4 =item * Florian Ragwitz =item * Ash Berlin =item * Chas. J. Owens IV =item * Chris Prather =item * Dave Rolsky =item * Devin Austin =item * Hans Dieter Pearcey =item * Justin Hunter =item * Matt Kraai =item * Michele Beltrame =item * Nelo Onyiah =item * nperez =item * Piers Cawley =item * Rafael Kitover =item * Robert 'phaylon' Sedlacek =item * Stevan Little =item * Tomas Doran =item * Yanick Champoux =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2011 by Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut