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

    MooseX::AttributeShortcuts 0.011

    Download button

    No screenshots available
    Downloads: 132  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Chris Weyl | More programs
    Perl Artistic License / FREE
    May 1st, 2012, 20:31 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    MooseX::AttributeShortcuts description

    Shorthand for common attribute options

    Ever find yourself repeatedly specifing writers and builders, because there's no good shortcut to specifying them? Sometimes you want an attribute to have a read-only public interface, but a private writer. And wouldn't it be easier to just say "builder => 1" and have the attribute construct the canonical "_build_$name" builder name for you?

    MooseX::AttributeShortcuts is a Perl module that causes an attribute trait to be applied to all attributes defined to the using class. This trait extends the attribute option processing to handle the above variations.

    SYNOPSIS

     package Some::Class;

     use Moose;
     use MooseX::AttributeShortcuts;

     # same as: is => 'ro', writer => '_set_foo'
     has foo => (is => 'rwp');

     # same as: is => 'ro', builder => '_build_bar'
     has bar => (is => 'ro', builder => 1);

     # same as: is => 'ro', clearer => 'clear_bar'
     has bar => (is => 'ro', clearer => 1);

     # same as: is => 'ro', predicate => 'has_bar'
     has bar => (is => 'ro', predicate => 1);

     # works as you'd expect for "private": predicate => '_has_bar'
     has _bar => (is => 'ro', predicate => 1);

     # or...
     package Some::Other::Class;

     use Moose;
     use MooseX::AttributeShortcuts -writer_prefix => '_';

     # same as: is => 'ro', writer => '_foo'
     has foo => (is => 'rwp');



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    attribute options | attribute shortcuts | Perl module | Perl | attribute | options

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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