MooseX::Types::Set::Object − Set::Object type with coercions and stuff.
package Foo; use Moose; use MooseX::Types::Set::Object; has children => ( isa => "Set::Object", accessor => "transition_set", coerce => 1, # also accept array refs handles => { children => "members", add_child => "insert", remove_child => "remove", # See Set::Object for all the methods you could delegate }, ); # ... my $foo = Foo−>new( children => [ @objects ] ); $foo−>add_child( $obj );
This module provides Moose type constraints (see Moose::Util::TypeConstraints, MooseX::Types).
Set::Object
A subtype of "Object" that isa Set::Object with coercions to and from the "ArrayRef" type.
Set::Object, MooseX::AttributeHandlers, MooseX::Types, Moose::Util::TypeConstraints
Yuval Kogman <nothingmuch AT woobling DOT org>
This software is copyright (c) 2010 by Yuval Kogman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.