NAME
Reindeer - Moose with more antlers
VERSION
version 0.003
SYNOPSIS
# ta-da!
use Reindeer;
# ...is the same as:
use Moose;
use MooseX::MarkAsMethods autoclean => 1;
use MooseX::AlwaysCoerce;
use MooseX::AttributeShortcuts;
# etc, etc, etc
DESCRIPTION
Like Moose? Use MooseX::* extensions? Maybe some MooseX::Types libraries? Hate that you have to use them in every. Single. Class.
Reindeer aims to resolve that :) Reindeer _is_ Moose -- it's just Moose with a number of the more useful/popular extensions already applied. Reindeer is a drop-in replacement for your "use Moose" line, that behaves in the exact same way... Just with more pointy antlers.
AVAILABLE ATTRIBUTE TRAITS
We make available the following trait aliases. These traits are NOT automatically applied to attributes, and can be used as:
has foo => (traits => [ AutoDestruct ], ...);
AutoDestruct
has foo => (
traits => [ AutoDestruct ],
is => 'ro',
lazy => 1,
builder => 1,
ttl => 600,
);
Allows for a "ttl" attribute option; this is the length of time (in seconds) that a stored value is allowed to live; after that time the value is cleared and the value rebuilt (given that the attribute is lazy and has a builder defined).
See MooseX::AutoDestruct for more information.
MultiInitArg
has 'data' => ( traits => [ MultiInitArg ], is => 'ro', isa => 'Str', init_args => [qw(munge frobnicate)], );
This trait allows your attribute to be initialized with any one of multiple arguments to new().
See MooseX::MultiInitArg for more information.
UndefTolerant
INCLUDED EXTENSIONS
Reindeer includes the traits and sugar provided by the following extensions. Everything their docs say they can do, you can do by default with Reindeer.
MooseX::AbstractMethod
MooseX::AlwaysCoerce
MooseX::AttributeShortcuts
MooseX::MarkAsMethods
Note that this causes any overloads you've defined in your class/role to be marked as methods, and namespace::autoclean invoked.
MooseX::NewDefaults
MooseX::StrictConstructor
INCLUDED TYPE LIBRARIES
MooseX::Types::Moose
MooseX::Types::Common::String
MooseX::Types::Common::Numeric
OTHER
Non-Moose specific items made available to your class/role:
namespace::autoclean
Technically, this is done by MooseX::MarkAsMethods, but it's worth pointing out here. Any overloads present in your class/role are marked as methods before autoclean is unleashed, so Everything Will Just Work as Expected.
Try::Tiny
CAVEAT
This author is applying his own assessment of "useful/popular extensions". You may find yourself in agreement, or violent disagreement with his choices. YMMV :)
SEE ALSO
Moose, Reindeer::Role, overload. All of the above referenced packages.
BUGS
All complex software has bugs lurking in it, and this module is no exception.
Bugs, feature requests and pull requests through GitHub are most welcome; our page and repo (same URI):
https://github.com/RsrchBoy/reindeer
AUTHOR
Chris Weyl <cweyl@alumni.drew.edu>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Chris Weyl.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999