Myco::Entity::Meta::Attribute

Container for meta data describing an attribute of a Myco Entity class
Download

Myco::Entity::Meta::Attribute Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • The myco project
  • Publisher web site:
  • http://search.cpan.org/~czbsd/Myco-0.01/lib/Myco.pm

Myco::Entity::Meta::Attribute Tags


Myco::Entity::Meta::Attribute Description

Container for meta data describing an attribute of a Myco Entity class Myco::Entity::Meta::Attribute is a container for meta data describing an attribute of a Myco Entity class.SYNOPSIS # Note this class is normally used only via # Myco::Entity::Meta ## Within an entity class definition - add attribute to class # ::Attribute's constructor should only be used via # ::Meta's add_attribute() as shown: my $md = Myco::Entity::Meta( name => __PACKAGE__ ); $md->add_attribute( name => 'doneness', type => 'int', readonly => 0, # default is read/write access_list => { rw => , ro => }, tangram_options => { required => 1}, synopsis => "How you'd like your meat cooked", syntax_msg => "correct format, please!", values => , value_labels => {0 => 'rare', 1 => 'medium-rare', 2 => 'medium', 3 => 'medium-well', 4 => 'well', 5 => 'charred'}, ui => { widget => , label => 'Cook until...', }, ); ## Typical post-setup usage # ...given a Myco::Entity::Meta enabled entity object $obj my $metadata = $obj->introspect; # Get reference to array of ::Meta::Attribute objects for $obj's class my $attributes = $metadata->get_attributes; # Look up attribute's type my $type = $attributes->{doneness}->get_type; # Use of stored accessor coderef - set doneness = 3 $attributes->{doneness}->setval($obj, 3); Requirements: · Perl


Myco::Entity::Meta::Attribute Related Software