1 package MooseX::AttributeHelpers::MethodProvider::Hash;
6 return sub { exists $attr->get_value($_[0])->{$_[1]} ? 1 : 0 };
11 return sub { $attr->get_value($_[0])->{$_[1]} };
16 if ($attr->has_container_type) {
17 my $container_type_constraint = $attr->container_type_constraint;
19 ($container_type_constraint->check($_[2]))
20 || confess "Value " . ($_[2]||'undef') . " did not pass container type constraint";
21 $attr->get_value($_[0])->{$_[1]} = $_[2]
25 return sub { $attr->get_value($_[0])->{$_[1]} = $_[2] };
31 return sub { keys %{$attr->get_value($_[0])} };
36 return sub { values %{$attr->get_value($_[0])} };
41 return sub { scalar keys %{$attr->get_value($_[0])} };
46 return sub { scalar keys %{$attr->get_value($_[0])} ? 1 : 0 };
51 return sub { delete $attr->get_value($_[0])->{$_[1]} };
62 MooseX::AttributeHelpers::MethodProvider::Hash
66 This is a role which provides the method generators for
67 L<MooseX::AttributeHelpers::Collection::Hash>.
77 =head1 PROVIDED METHODS
101 All complex software has bugs lurking in it, and this module is no
102 exception. If you find a bug please either email me, or add the bug
107 Stevan Little E<lt>stevan@iinteractive.comE<gt>
109 =head1 COPYRIGHT AND LICENSE
111 Copyright 2007 by Infinity Interactive, Inc.
113 L<http://www.iinteractive.com>
115 This library is free software; you can redistribute it and/or modify
116 it under the same terms as Perl itself.