| Net-Google-DataAPI documentation | Contained in the Net-Google-DataAPI distribution. |
Net::Google::DataAPI::Role::HasContent - provides 'param' method to Entry
package MyEntry;
use Any::Moose;
with qw(
Net::Google::DataAPI::Role::Entry
Net::Google::DataAPI::Role::HasContent
);
1;
Net::Google::DataAPI::Role::HasContent provides 'param' method to Entry.
Nobuo Danjou <nobuo.danjou@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Net-Google-DataAPI documentation | Contained in the Net-Google-DataAPI distribution. |
package Net::Google::DataAPI::Role::HasContent; use Any::Moose '::Role'; our $VERSION='0.03'; requires 'update'; has content => ( isa => 'HashRef', is => 'rw', lazy_build => 1, trigger => sub { $_[0]->update }, ); sub _build_content { +{} } sub param { my ($self, $arg) = @_; return $self->content unless $arg; if (ref $arg eq 'HASH') { return $self->content( { %{$self->content}, %$arg, } ); } else { return $self->content->{$arg}; } } no Any::Moose '::Role'; 1; __END__