Class::groups

Class::groups is Pragma created to implement group of properties.
Download

Class::groups Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Domizio Demichelis
  • Publisher web site:
  • http://search.cpan.org/~domizio/CGI-Application-Plus-1.21/lib/CGI/Application/CheckRM.pm

Class::groups Tags


Class::groups Description

Class::groups is Pragma created to implement group of properties. Class::groups is Pragma created to implement group of properties.SYNOPSISClass package MyClass ; # implement group method without options use Class::groups qw(this that) ; # implement group method with properties use Class::groups { name => 'myGroup' , props => } ; # with options use Class::groups { name => 'myOtherGroup' , no_strict => 1 , default => { aProp => 'some value' } , pre_process=> sub { if ( ref $_ eq 'ARRAY' ) { $_ = { map { $_=>$_ } @{$_} } } } , props => , default => 'something' } ] } ;Usage MyClass->myGroup(%hash) ; # same thing MyClass->myGroup( prop1 => 1 , prop2 => 2 ) ; $hash_ref = MyClass->myGroup $value = MyClass->prop2 ; # $value == 2 $value = MyClass->myGroup('prop2') ; # $value == 2 $value = $MyClass::myGroup{prop2} ; # $value == 2 $value = $$hash_ref{prop2} ; # $value == 2 ($p1, $p2) = MyClass->myGroup() ; # the default will initialize the hash reference $other_hash_ref = MyClass->myOtherGroup $value = $other_hash_ref->{prop3} # $value eq 'something' # adding an unknow property (see no_strict) MyClass->myOtherGroup(prop5 => 5) ; # copying the whole hash %myGroupHash = MyClass->myGroup Requirements: · Perl


Class::groups Related Software