From: Chris Prather Date: Tue, 17 Jul 2007 02:46:56 +0000 (+0000) Subject: Add future ideas file X-Git-Tag: 0.18_01~70 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f3c3526cda7de372862dd3dd58fed1ea74118a4;p=gitmo%2FMooseX-AttributeHelpers.git Add future ideas file r25262@alice-3: perigrin | 2007-07-11 14:48:15 -0500 updates for 0.0.2 r25669@alice-3: perigrin | 2007-07-16 21:45:56 -0500 add delete method --- diff --git a/lib/MooseX/AttributeHelpers/Collection/Hash.pm b/lib/MooseX/AttributeHelpers/Collection/Hash.pm index 6fa7bca..1e6ac2a 100644 --- a/lib/MooseX/AttributeHelpers/Collection/Hash.pm +++ b/lib/MooseX/AttributeHelpers/Collection/Hash.pm @@ -50,6 +50,10 @@ has '+method_constructors' => ( my $attr = shift; return sub { scalar keys %{$attr->get_value($_[0])} ? 1 : 0 }; } + 'delete' => sub { + my $attr = shift; + return sub { delete $attr->get_value($_[0])->{$_[1]} }; + } } } );