NAME
App::Dochazka::Model - functions shared by several modules within the data model
VERSION
Version 0.181
SYNOPSIS
Shared data model functions. All three functions are designed to be used together as follows:
package My::Package;
use Params::Validate qw( :all );
BEGIN {
no strict 'refs';
*{"spawn"} = App::Dochazka::Model::make_spawn;
*{"reset"} = App::Dochazka::Model::make_reset(
'attr1', 'attr2',
);
*{"attr1"} = App::Dochazka::Model::make_accessor( 'attr1' );
*{"attr2"} = App::Dochazka::Model::make_accessor( 'attr2', HASHREF );
}
What this does:
create a
spawn
class method in your classcreate a
reset
instance method in your classcreate a
attr1
accessor method in your class (type defaults to SCALAR)create a
attr2
accessor method in your class (type HASHREF)
FUNCTIONS
make_spawn
Returns a ready-made 'spawn' method for your class/package/module.
make_filter
Given a list of attributes, returns a ready-made 'filter' routine which takes a PROPLIST and returns a new PROPLIST from which all bogus properties have been removed.
make_reset
Given a list of attributes, returns a ready-made 'reset' method.
make_accessor
Returns a ready-made accessor.
make_TO_JSON
Returns a ready-made TO_JSON
make_compare
Returns a ready-made 'compare' method that can be used to determine if two objects are the same.
make_clone
Returns a ready-made 'clone' method.
AUTHOR
Nathan Cutler, <presnypreklad@gmail.com>