Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / MooseX / Declare / Syntax / EmptyBlockIfMissing.pm
1 package MooseX::Declare::Syntax::EmptyBlockIfMissing;
2
3 use Moose::Role;
4
5 use namespace::clean -except => 'meta';
6
7 sub handle_missing_block {
8     my ($self, $ctx, $inject, %args) = @_;
9
10     # default to block with nothing more than the default contents
11     $ctx->inject_code_parts_here("{ $inject }");
12 }
13
14 1;
15
16 __END__
17
18 =head1 NAME
19
20 MooseX::Declare::Syntax::EmptyBlockIfMissing
21
22 =head1 DESCRIPTION
23
24 The L<MooseX::Declare::Syntax::NamespaceHandling> role will require that the
25 consumer handles the case of non-existant blocks. This role will inject
26 an empty block with only the generated code parts in it.
27
28 =head1 METHODS
29
30 =head2 handle_missing_block
31
32   Object->handle_missing_block (Object $context, Str $body, %args)
33
34 This will inject the generated code surrounded by C<{ ... }> into the code
35 where the keyword was called.
36
37 =head1 SEE ALSO
38
39 =over
40
41 =item * L<MooseX::Declare>
42
43 =item * L<MooseX::Declare::Syntax::NamespaceHandling>
44
45 =back
46
47 =head1 AUTHOR, COPYRIGHT & LICENSE
48
49 See L<MooseX::Declare>
50
51 =cut