1 package MooseX::AttributeHelpers::MethodProvider::ImmutableHash;
5 $VERSION = eval $VERSION;
6 our $AUTHORITY = 'cpan:STEVAN';
9 my ($attr, $reader, $writer) = @_;
10 return sub { CORE::exists $reader->($_[0])->{$_[1]} ? 1 : 0 };
14 my ($attr, $reader, $writer) = @_;
17 $reader->($_[0])->{$_[1]}
19 my ( $self, @keys ) = @_;
20 @{ $reader->($self) }{@keys}
26 my ($attr, $reader, $writer) = @_;
27 return sub { CORE::keys %{$reader->($_[0])} };
31 my ($attr, $reader, $writer) = @_;
32 return sub { CORE::values %{$reader->($_[0])} };
36 my ($attr, $reader, $writer) = @_;
38 my $h = $reader->($_[0]);
46 my ($attr, $reader, $writer) = @_;
47 return sub { scalar CORE::keys %{$reader->($_[0])} };
51 my ($attr, $reader, $writer) = @_;
52 return sub { scalar CORE::keys %{$reader->($_[0])} ? 1 : 0 };
63 MooseX::AttributeHelpers::MethodProvider::ImmutableHash
67 This is a role which provides the method generators for
68 L<MooseX::AttributeHelpers::Collection::ImmutableHash>.
78 =head1 PROVIDED METHODS
100 All complex software has bugs lurking in it, and this module is no
101 exception. If you find a bug please either email me, or add the bug
106 Stevan Little E<lt>stevan@iinteractive.comE<gt>
108 =head1 COPYRIGHT AND LICENSE
110 Copyright 2007-2008 by Infinity Interactive, Inc.
112 L<http://www.iinteractive.com>
114 This library is free software; you can redistribute it and/or modify
115 it under the same terms as Perl itself.