From: Stevan Little Date: Thu, 31 May 2007 17:19:45 +0000 (+0000) Subject: foop X-Git-Tag: 0.18_01~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa4df2e612fc159e35ecc210e4b8e3ff10f46160;p=gitmo%2FMooseX-AttributeHelpers.git foop --- diff --git a/lib/MooseX/AttributeHelpers.pm b/lib/MooseX/AttributeHelpers.pm index 138ceb8..dddde08 100644 --- 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 --- 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]} };