| 1 | package WWW::PubNub::Message; | ||||||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:GETTY'; | |||||||||||||
| 3 | # ABSTRACT: PubNub Message | ||||||||||||||
| 4 | 1 | $WWW::PubNub::Message::VERSION = '0.001'; | |||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 1 | ▶ | use Scalar::Util qw( looks_like_number ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | |||||||||||||||
| 8 | 1 | has pubnub => ( | |||||||||||||
| 9 | is => 'ro', | ||||||||||||||
| 10 | required => 1, | ||||||||||||||
| 11 | ); | ||||||||||||||
| 12 | |||||||||||||||
| 13 | 1 | has response => ( | |||||||||||||
| 14 | is => 'ro', | ||||||||||||||
| 15 | required => 1, | ||||||||||||||
| 16 | ); | ||||||||||||||
| 17 | |||||||||||||||
| 18 | 1 | has request => ( | |||||||||||||
| 19 | is => 'ro', | ||||||||||||||
| 20 | required => 1, | ||||||||||||||
| 21 | ); | ||||||||||||||
| 22 | |||||||||||||||
| 23 | 1 | has message => ( | |||||||||||||
| 24 | is => 'ro', | ||||||||||||||
| 25 | required => 1, | ||||||||||||||
| 26 | ); | ||||||||||||||
| 27 | |||||||||||||||
| 28 | 1 | has channel => ( | |||||||||||||
| 29 | is => 'ro', | ||||||||||||||
| 30 | predicate => 1, | ||||||||||||||
| 31 | ); | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 0 | ▶ | sub get { | ||||||||||||
|
Subroutine
get: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 34 | 0 | my ( $self, $key ) = @_; | |||||||||||||
| 35 | 0 | ▶ | return $self->message unless defined $key; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 36 | 0 | ▶ | if (ref $self->message eq 'ARRAY') { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 37 | 0 | ▶ | return $self->message->[$key] if looks_like_number($key); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 38 | } elsif ($self->message eq 'HASH') { | ||||||||||||||
| 39 | 0 | return $self->message->{$key}; | |||||||||||||
| 40 | } | ||||||||||||||
| 41 | 0 | return; | |||||||||||||
| 42 | } | ||||||||||||||
| 43 | |||||||||||||||
| 44 | 1 | 1; | |||||||||||||
| 45 | |||||||||||||||
| 46 | __END__ | ||||||||||||||