ActiveResource
view release on metacpan or search on metacpan
lib/ActiveResource/Base.pm view on Meta::CPAN
$self->attributes->{$sub} = ref($args[0]) ? $args[0] : { text => $args[0] };
return $self;
}
my $attr = $self->attributes->{$sub};
return $attr if !ref $attr;
return $attr->{text} if $attr->{text};
return Hash::AsObject->new($attr);
}
# protected methods start from here
sub load_attributes_from_response {
my ($self, $response) = @_;
my $record_xml = $response->content;
return unless $record_xml;
my $hash = $self->format->decode($record_xml);
my (undef, $attr) = each %$hash;
$self->load($attr);
( run in 0.247 second using v1.01-cache-2.11-cpan-0d8aa00de5b )