Mason::Compilation - Performs compilation of a single component
A new Mason::Compilation object is created by Mason::Interp to compile each component.
Mason::Compilation
This class has no public API at this time.
These methods are not intended to be called externally, but may be useful to modify with method modifiers in plugins and subclasses. We will attempt to keep their APIs stable.
A list of attribute names that should not be used because they are reserved for built-in attributes or methods: args, m, cmeta, render, main, etc.
args
m
cmeta
render
main
A list of method names that should not be used because they are reserved for built-in attributes: args, m, cmeta, etc. Not as extensive as bad_attribute_names above because methods like render and main can be overriden but make no sense as attributes.
The top-level method called to compile the component. Returns the generated component class.
An arrayref of valid named block types: after, filter, method, etc. Add to this list if you want to create your own named blocks (i.e. blocks that take a name argument).
after
filter
method
Perl code to be added at the bottom of the class. Empty by default.
Perl code to be added at the top of the class, just after initialization of Moose, $m and other required pieces. Empty by default.
$m
# Add to the top of every component class: # use Foo; # use Bar qw(baz); # override 'output_class_header' => sub { return join("\n", super(), 'use Foo;', 'use Bar qw(baz);'); };
This method is called on each distinct piece of Perl code in the component. $coderef is a reference to a string containing the code; the method can modify the code as desired. See Mason::Plugin::DollarDot for a sample usage.
$coderef
An arrayref of valid unnamed block types: args, class, init, etc. Add to this list if you want to create your own unnamed blocks.
class
init
An arrayref of valid flags: contains only extends at time of writing. Add to this list if you want to create your own flags.
extends
Mason
Jonathan Swartz <swartz@pobox.com>
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Mason, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mason
CPAN shell
perl -MCPAN -e shell install Mason
For more information on module installation, please visit the detailed CPAN module installation guide.