1 package MooseX::AttributeHelpers::MethodProvider::ImmutableHash;
5 our $AUTHORITY = 'cpan:STEVAN';
8 my ($attr, $reader, $writer) = @_;
9 return sub { CORE::exists $reader->($_[0])->{$_[1]} ? 1 : 0 };
13 my ($attr, $reader, $writer) = @_;
16 $reader->($_[0])->{$_[1]}
18 my ( $self, @keys ) = @_;
19 @{ $reader->($self) }{@keys}
25 my ($attr, $reader, $writer) = @_;
26 return sub { CORE::keys %{$reader->($_[0])} };
30 my ($attr, $reader, $writer) = @_;
31 return sub { CORE::values %{$reader->($_[0])} };
35 my ($attr, $reader, $writer) = @_;
37 my $h = $reader->($_[0]);
45 my ($attr, $reader, $writer) = @_;
46 return sub { scalar CORE::keys %{$reader->($_[0])} };
50 my ($attr, $reader, $writer) = @_;
51 return sub { scalar CORE::keys %{$reader->($_[0])} ? 1 : 0 };
62 MooseX::AttributeHelpers::MethodProvider::ImmutableHash
66 This is a role which provides the method generators for
67 L<MooseX::AttributeHelpers::Collection::ImmutableHash>.
77 =head1 PROVIDED METHODS
99 All complex software has bugs lurking in it, and this module is no
100 exception. If you find a bug please either email me, or add the bug
105 Stevan Little E<lt>stevan@iinteractive.comE<gt>
107 =head1 COPYRIGHT AND LICENSE
109 Copyright 2007-2008 by Infinity Interactive, Inc.
111 L<http://www.iinteractive.com>
113 This library is free software; you can redistribute it and/or modify
114 it under the same terms as Perl itself.