| 1 | package Net::Google::DataAPI::Role::HasContent; | ||||||||||
| 2 | 1 | ▶ | use Any::Moose '::Role'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | our $VERSION='0.03'; | |||||||||
| 4 | |||||||||||
| 5 | 1 | requires 'update'; | |||||||||
| 6 | |||||||||||
| 7 | has content => ( | ||||||||||
| 8 | isa => 'HashRef', | ||||||||||
| 9 | is => 'rw', | ||||||||||
| 10 | lazy_build => 1, | ||||||||||
| 11 | 2 | ▶ | trigger => sub { $_[0]->update }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ); | |||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub _build_content { +{} } | ||||||||
|
Subroutine
_build_content: not called CC=1 SCAR=6.9
| |||||||||||
| 15 | |||||||||||
| 16 | sub param { | ||||||||||
| 17 | 4 | ▶ | my ($self, $arg) = @_; | ||||||||
|
Subroutine
param: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 18 | 4 | ▶ | return $self->content unless $arg; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 3 | ▶ | if (ref $arg eq 'HASH') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | return $self->content( | ||||||||||
| 21 | { | ||||||||||
| 22 | 1 | %{$self->content}, | |||||||||
| 23 | %$arg, | ||||||||||
| 24 | } | ||||||||||
| 25 | ); | ||||||||||
| 26 | } else { | ||||||||||
| 27 | 2 | return $self->content->{$arg}; | |||||||||
| 28 | } | ||||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | no Any::Moose '::Role'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 32 | |||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||
| 36 | |||||||||||
| 37 | =pod | ||||||||||
| 38 | |||||||||||
| 39 | =head1 NAME | ||||||||||
| 40 | |||||||||||
| 41 | Net::Google::DataAPI::Role::HasContent - provides 'param' method to Entry | ||||||||||
| 42 | |||||||||||
| 43 | =head1 SYNOPSIS | ||||||||||
| 44 | |||||||||||
| 45 | package MyEntry; | ||||||||||
| 46 | use Any::Moose; | ||||||||||
| 47 | with qw( | ||||||||||
| 48 | Net::Google::DataAPI::Role::Entry | ||||||||||
| 49 | Net::Google::DataAPI::Role::HasContent | ||||||||||
| 50 | ); | ||||||||||
| 51 | |||||||||||
| 52 | 1; | ||||||||||
| 53 | |||||||||||
| 54 | =head1 DESCRIPTION | ||||||||||
| 55 | |||||||||||
| 56 | Net::Google::DataAPI::Role::HasContent provides 'param' method to Entry. | ||||||||||
| 57 | |||||||||||
| 58 | =head1 AUTHOR | ||||||||||
| 59 | |||||||||||
| 60 | Nobuo Danjou E<lt>danjou@soffritto.orgE<gt> | ||||||||||
| 61 | |||||||||||
| 62 | =head1 LICENSE | ||||||||||
| 63 | |||||||||||
| 64 | This library is free software; you can redistribute it and/or modify | ||||||||||
| 65 | it under the same terms as Perl itself. | ||||||||||
| 66 | |||||||||||
| 67 | =cut | ||||||||||