The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Dochazka::Model::Shared - functions shared by several modules within the data model

VERSION

Version 0.153

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::Shared::make_spawn;
        *{"reset"} = App::Dochazka::Model::Shared::make_reset(
            'attr1', 'attr2'
        );
        *{"attr1"} = App::Dochazka::Model::Shared::make_accessor( 'attr1' );
        *{"attr2"} = App::Dochazka::Model::Shared::make_accessor( 'attr2', HASHREF );
    }

What this does:

  • create a spawn class method in your class

  • create a reset instance method in your class

  • create 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_reset

Given a list of attributes, returns a ready-made 'reset' method.

make_accessor

Returns a ready-made accessor.

AUTHOR

Nathan Cutler, <presnypreklad@gmail.com>