Bolts::Meta::Class::Trait::Bag - Metaclass role for Bolts-built bags
version 0.143171
While a bag may be any kind of object, this metaclass role on a bag provides some helpful utilities for creating and managing bags.
These are the artifacts that have been added to this bag. It is saved as a hash. You can get the hash of artifacts as a list using list_artifacts. You add artifacts to this list using "add_artifact".
list_artifacts
This is a Moose::Meta::TypeConstraint to apply to the "isa_type" in Bolts::Artifact of all contained artifacts.
This is a Moose::Meta::TypeConstraint to apply to the "does_type" in Bolts::Artifact of all contained artifacts.
my $finished = $meta->is_finished_bag;
This is used to determine if a bag's definition has already been performed and completed. At this time, it's just a synonym for "is_immutable" in Class::MOP::Class.
$meta->add_artifact(name => $artifact, { isa => $isa_type, does => $does_type, });
Adds an artifact method to the bag with the given name. The $artifact may be an instance of Bolts::Role::Artifact, a code reference to used to define a Bolts::Artifact::Thunk or just another value, which will be wrapped in an anonymous sub and turned into a Bolts::Artifact::Thunk.
name
$artifact
The isa and does will be applied to the artifact as appropriate.
isa
does
$meta->finish_bag;
This completes the bag building process and marks the Moose object as immutable. Aft this is called, "is_finished_bag" returns true.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bolts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bolts
CPAN shell
perl -MCPAN -e shell install Bolts
For more information on module installation, please visit the detailed CPAN module installation guide.