| 1 | package Google::API::Base; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 4 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 27 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 8 | 27 | my $class = shift; | |||||||||
| 9 | 27 | bless {}, $class; | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 142 | ▶ | sub set_attr { | ||||||||
|
Subroutine
set_attr: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | 142 | my $self = shift; | |||||||||
| 14 | 142 | my ($name, $callback) = @_; | |||||||||
| 15 | 142 | $self->{METHODS}{$name} = $callback; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 4 | our $AUTOLOAD; | |||||||||
| 19 | 29 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||
| 20 | 29 | my $self = shift; | |||||||||
| 21 | 29 | my (%param) = @_; | |||||||||
| 22 | 29 | my $func_name = $AUTOLOAD; | |||||||||
| 23 | 29 | $func_name =~ s/^.*:://; | |||||||||
| 24 | 29 | ▶ | return if $func_name eq 'DESTROY'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 2 | ▶ | if (exists $self->{METHODS}{$func_name}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 1 | return $self->{METHODS}{$func_name}->(%param); | |||||||||
| 27 | } | ||||||||||
| 28 | 1 | Carp::croak("Unknown method: $func_name"); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 4 | 1; | |||||||||
| 32 | __END__ | ||||||||||