Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::mason::methodmaker(3pm) [debian man page]

HTML::Mason::MethodMaker(3pm)				User Contributed Perl Documentation			     HTML::Mason::MethodMaker(3pm)

NAME
HTML::Mason::MethodMaker - Used to create simple get & get/set methods in other classes SYNOPSIS
use HTML::Mason::MethodMaker ( read_only => 'foo', read_write => [ [ bar => { type => SCALAR } ], [ baz => { isa => 'HTML::Mason::Baz' } ], 'quux', # no validation ], read_write_contained => { other_object => [ [ 'thing1' => { isa => 'Thing1' } ], 'thing2', # no validation ] }, ); DESCRIPTION
This automates the creation of simple accessor methods. USAGE
This module creates methods when it is "use"'d by another module. There are three types of methods: 'read_only', 'read_write', 'read_write_contained'. Attributes specified as 'read_only' get an accessor that only returns the value of the attribute. Presumably, these attributes are set via more complicated methods in the class or as a side effect of one of its methods. Attributes specified as 'read_write' will take a single optional parameter. If given, this parameter will become the new value of the attribute. This value is then returned from the method. If no parameter is given, then the current value is returned. If you want the accessor to use "Params::Validate" to validate any values passed to the accessor (and you _do_), then the the accessor specification should be an array reference containing two elements. The first element is the accessor name and the second is the validation spec. The 'read_write_contained' parameter is used to create accessor for delayed contained objects. A delayed contained object is one that is not created in the containing object's accessor, but rather at some point after the containing object is constructed. For example, the Interpreter object creates Request objects after the Interpreter itself has been created. The value of the 'read_write_contained' parameter should be a hash reference. The keys are the internal name of the contained object, such as "request" or "compiler". The values for the keys are the same as the parameters given for 'read_write' accessors. SEE ALSO
HTML::Mason perl v5.14.2 2012-02-04 HTML::Mason::MethodMaker(3pm)

Check Out this Related Man Page

HTML::Mason::Compiler::ToObject(3pm)			User Contributed Perl Documentation		      HTML::Mason::Compiler::ToObject(3pm)

NAME
HTML::Mason::Compiler::ToObject - A Compiler subclass that generates Mason object code SYNOPSIS
my $compiler = HTML::Mason::Compiler::ToObject->new; my $object_code = $compiler->compile( comp_source => $source, name => $comp_name, comp_path => $comp_path, ); DESCRIPTION
This Compiler subclass generates Mason object code (Perl code). It is the default Compiler class used by Mason. PARAMETERS TO THE new() CONSTRUCTOR All of these parameters are optional. comp_class The class into which component objects are blessed. This defaults to HTML::Mason::Component. subcomp_class The class into which subcomponent objects are blessed. This defaults to HTML::Mason::Component::Subcomponent. in_package This is the package in which a component's code is executed. For historical reasons, this defaults to "HTML::Mason::Commands". preamble Text given for this parameter is placed at the beginning of each component, but after the execution of any "<%once>" block. See also postamble. The request will be available as $m in preamble code. postamble Text given for this parameter is placed at the end of each component. See also preamble. The request will be available as $m in postamble code. use_strict True or false, default is true. Indicates whether or not a given component should "use strict". named_component_subs When compiling a component, use uniquely named subroutines for the a component's body, subcomponents, and methods. Doing this allows you to effectively profile Mason components. Without this, all components simply show up as __ANON__ or something similar in the profiler. define_args_hash One of "always", "auto", or "never". This determines whether or not an %ARGS hash is created in components. If it is set to "always", one is always defined. If set to "never", it is never defined. The default, "auto", will cause the hash to be defined only if some part of the component contains the string "ARGS". This is somewhat crude, and may result in some false positives, but this is preferable to false negatives. Not defining the args hash means that we can avoid copying component arguments, which can save memory and slightly improve execution speed. ACCESSOR METHODS
All of the above properties have read-only accessor methods of the same name. You cannot change any property of a compiler after it has been created (but you can create multiple compilers with different properties). METHODS
This class is primarily meant to be used by the Interpreter object, and as such has a very limited public API. compile(...) This method will take component source and return the compiled object code for that source. See "compile(...)" in HTML::Mason::Compiler for details on this method. This subclass also accepts a "comp_class" parameter, allowing you to override the class into which the component is compiled. perl v5.14.2 2012-02-04 HTML::Mason::Compiler::ToObject(3pm)
Man Page