Class::ReluctantORM::Base - Class building helper
package Person; use base 'Class::ReluctantORM::Base'; __PACKAGE__->build_class( fields => [ qw(person_id name birthdate) ], ro_fields => [ qw(person_id) ], # See Class::ReluctantORM ); # Now you have... package main; my $p = Person->new(name => 'SuchAndSuch', birthdate => '2008-01-12'); print $p->name . " was born on " . $p->birthdate() . "\n"; $p->name('WhatsTheirFace'); $p->person_id(123); # Kaboom, person_id is readonly
Provides class-building facilities for Class::ReluctantORM, including defining accessors and mutators.
Class::ReluctantORM, which leverages this class heavily.
Sets up $class to have the accessors and mutators given.
Extra parameters are ignored.
An array ref of field names, which will be used to create accessors, and if not listed in ro_fields, also mutators.
An array ref of field names, which will be restricted to be read-only.
Returns a list of the field names for the given class.
Clinton Wolfe
To install Class::ReluctantORM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::ReluctantORM
CPAN shell
perl -MCPAN -e shell install Class::ReluctantORM
For more information on module installation, please visit the detailed CPAN module installation guide.