From: Yuval Kogman Date: Wed, 6 Jun 2007 19:06:12 +0000 (+0000) Subject: fix bug X-Git-Tag: 0_02~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Storage.git;a=commitdiff_plain;h=f6e1331f9a610298585caaffe32ef3eb69768722 fix bug --- diff --git a/lib/MooseX/Storage/Engine.pm b/lib/MooseX/Storage/Engine.pm index 49e5664..fb172e8 100644 --- a/lib/MooseX/Storage/Engine.pm +++ b/lib/MooseX/Storage/Engine.pm @@ -54,8 +54,8 @@ sub expand_object { ## this is the internal API ... sub collapse_attribute { - my ($self, $attr, @args) = @_; - $self->storage->{$attr->name} = $self->collapse_attribute_value($attr, @args) || return; + my ($self, $attr, $options) = @_; + $self->storage->{$attr->name} = $self->collapse_attribute_value($attr, $options) || return; } sub expand_attribute { @@ -64,7 +64,7 @@ sub expand_attribute { } sub collapse_attribute_value { - my ($self, $attr, @args) = @_; + my ($self, $attr, $options) = @_; my $value = $attr->get_value($self->object); # NOTE: @@ -78,7 +78,7 @@ sub collapse_attribute_value { my $type_converter = $self->find_type_handler($attr->type_constraint); (defined $type_converter) || confess "Cannot convert " . $attr->type_constraint->name; - $value = $type_converter->{collapse}->($value, @args); + $value = $type_converter->{collapse}->($value, $options); } return $value; } @@ -253,7 +253,7 @@ my %TYPES = ( # other real version. +{ map { blessed($hash->{$_}) - ? ($_ => $OBJECT_HANDLERS{collapse}->($hash->{$_}), @args) + ? ($_ => $OBJECT_HANDLERS{collapse}->($hash->{$_}, @args)) : ($_ => $hash->{$_}) } keys %$hash } }