Class::FrameworkInterface which combines Class::Accessor, fields, and Class::MethodVars to ease creating a Class | |
Download |
Class::Framework Ranking & Summary
Advertisement
- License:
- GPL
- Price:
- FREE
- Publisher Name:
- Timothy Hinchcliffe
- Publisher web site:
- http://search.cpan.org/~thinch/
Class::Framework Tags
Class::Framework Description
Interface which combines Class::Accessor, fields, and Class::MethodVars to ease creating a Class Class::Framework is a Perl module intended to allow you to rapidly create a class using fields with Class::Accessor generated accessors along with Class::MethodVars methods.Inheriting from other classes built using Class::Framework or Class::MethodVars will automatically inherit their fields. You can inherit from any other class with the -base=> option to save an extra "use base" line.SYNOPSIS package Pixel; use warnings; # You always do this don't you... use strict; # This module is strict-safe (unless you use -varargs, but see Class::MethodVars for that). use Class::Framework -fields=>qw( x y colour ); sub _INIT :Method { unless (grep { this->colour eq $_ } qw( red green blue yellow white black )) { require Carp; Carp::croak "${^_colour} is not a recognised colour!"; } } sub print_To_Array($) :Method(. arrayref) { ${^_arrayref}->-> = this->colour; } 1; __END__ Requirements: · Perl
Class::Framework Related Software