projects
/
gitmo/MooseX-AttributeHelpers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
ae2c330
)
foop
Stevan Little [Thu, 31 May 2007 17:19:45 +0000 (17:19 +0000)]
lib/MooseX/AttributeHelpers.pm
patch
|
blob
|
blame
|
history
lib/MooseX/AttributeHelpers/Collection/Hash.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/MooseX/AttributeHelpers.pm
b/lib/MooseX/AttributeHelpers.pm
index
138ceb8
..
dddde08
100644
(file)
--- a/
lib/MooseX/AttributeHelpers.pm
+++ b/
lib/MooseX/AttributeHelpers.pm
@@
-19,12
+19,12
@@
__END__
=head1 NAME
+MooseX::AttributeHelpers
+
=head1 SYNOPSIS
=head1 DESCRIPTION
-=head1 METHODS
-
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
diff --git
a/lib/MooseX/AttributeHelpers/Collection/Hash.pm
b/lib/MooseX/AttributeHelpers/Collection/Hash.pm
index
27f2a9e
..
6fa7bca
100644
(file)
--- a/
lib/MooseX/AttributeHelpers/Collection/Hash.pm
+++ b/
lib/MooseX/AttributeHelpers/Collection/Hash.pm
@@
-12,6
+12,10
@@
sub helper_type { 'HashRef' }
has '+method_constructors' => (
default => sub {
return +{
+ 'exists' => sub {
+ my $attr = shift;
+ return sub { exists $attr->get_value($_[0])->{$_[1]} ? 1 : 0 };
+ },
'get' => sub {
my $attr = shift;
return sub { $attr->get_value($_[0])->{$_[1]} };