1 package MooseX::Declare::Context::Parameterized;
4 use MooseX::Types::Moose qw/Str HashRef/;
6 use namespace::autoclean;
8 has parameter_signature => (
11 predicate => 'has_parameter_signature',
17 default => sub { {} },
19 add_parameter => 'set',
20 get_parameters => 'kv',
24 sub strip_parameter_signature {
27 my $signature = $self->strip_proto;
29 $self->parameter_signature($signature)
30 if defined $signature && length $signature;
40 MooseX::Declare::Context::Parameterized - context for parsing optionally parameterized statements
44 This context trait will add optional parameterization functionality to the
49 =head2 parameter_signature
51 This will be set when the C<strip_parameter_signature> method is called and it
52 was able to extract a list of parameterisations.
56 =head2 has_parameter_signature
58 Predicate method for the C<parameter_signature> attribute.
60 =head2 strip_parameter_signature
62 Maybe[Str] Object->strip_parameter_signature()
64 This method is intended to parse the main namespace of a namespaced keyword.
65 It will use L<Devel::Declare::Context::Simple>s C<strip_word> method and store
66 the result in the L</namespace> attribute if true.
70 Allows storing parameters extracted from C<parameter_signature> to be used
75 Returns all previously added parameters.
81 =item * L<MooseX::Declare>
83 =item * L<MooseX::Declare::Context>
87 =head1 AUTHOR, COPYRIGHT & LICENSE
89 See L<MooseX::Declare>