1 package MooseX::Declare::Syntax::EmptyBlockIfMissing;
5 use namespace::clean -except => 'meta';
7 sub handle_missing_block {
8 my ($self, $ctx, $inject, %args) = @_;
10 # default to block with nothing more than the default contents
11 $ctx->inject_code_parts_here("{ $inject }");
20 MooseX::Declare::Syntax::EmptyBlockIfMissing
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.
30 =head2 handle_missing_block
32 Object->handle_missing_block (Object $context, Str $body, %args)
34 This will inject the generated code surrounded by C<{ ... }> into the code
35 where the keyword was called.
41 =item * L<MooseX::Declare>
43 =item * L<MooseX::Declare::Syntax::NamespaceHandling>
47 =head1 AUTHOR, COPYRIGHT & LICENSE
49 See L<MooseX::Declare>