Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Myco::Base::Entity::Meta::Attribute 1.22

    Download button

    No screenshots available
    Downloads: 293  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    The myco project | More programs
    Perl Artistic License / FREE
    November 17th, 2008, 16:09 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Myco::Base::Entity::Meta::Attribute description

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

    Myco::Base::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::Base::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::Base::Entity::Meta( name => __PACKAGE__ );
     $md->add_attribute(
     name => 'doneness',
     type => 'int',
     readonly => 0, # default is read/write
     access_list => { rw => ['admin'],
     ro => [qw(average_joes junior_admins)] },
     tangram_options => { required => 1},
     synopsis => "How you'd like your meat cooked",
     syntax_msg => "correct format, please!",
     values => [qw(0 1 2 3 4 5)],
     value_labels => {0 => 'rare',
     1 => 'medium-rare',
     2 => 'medium',
     3 => 'medium-well',
     4 => 'well',
     5 => 'charred'},
     ui => { widget => [ 'popup_menu' ],
     label => 'Cook until...',
     },
     );

     ## Typical post-setup usage
     # ...given a Myco::Base::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);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Myco Entity | meta attribute | Perl module | Perl | Myco | Entity

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM