Class::Methodist

Define methods for instance variables in a class
Download

Class::Methodist Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tom Nurkkala
  • Publisher web site:
  • http://search.cpan.org/~nurk/

Class::Methodist Tags


Class::Methodist Description

Define methods for instance variables in a class Class::Methodist is a Perl module that can be used to define methods for instance variables in a class.SYNOPSIS package My::Shiny::New::Class; use Class::Methodist ( scalar => 'global_config_path', hash => 'unique_words', list => 'file_names', object => { name => 'thing', class => 'My::Thing:Class' }, enum => { name => 'color', domain => }, scalars => ); sub new { my ($class, $alpha) = @_; $class->beget(alpha => $alpha, beta => 42); }This package creates instance variables and methods on a class for accessing and manipulating those instance variables. Class::Methodist is similar in spirit to Class::MakeMethods, but with a simpler interface and more sensible semantics.Instance variables to be defined are given as a list of instance variable specifications (a.k.a. specification) when the module is used. A specification consists of a pair whose first element is the type of the variable (e.g., scalar, hash, list) and whose second element is the name of the variable to be defined. The latter must be a valid Perl identifier name.For each specification, the module defines a type-specific set of methods on the calling class. The names of these methods usually include the name of the instance variable. In the following sections, we refer to the instance variable name by the generic identifier inst_var.In your constructor you must call the beget class method to instantiate and initialize each instance of the class. Requirements: · Perl


Class::Methodist Related Software