| 1 | package AnyEvent::Stomper::Frame; | ||
| 2 | |||
| 3 | 5 | ▶ | use 5.008000; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 5 | our $VERSION = '0.36'; | |
| 8 | |||
| 9 | 5 | ▶ | use Encode qw( decode ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | |||
| 12 | 1 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 13 | 1 | my $class = shift; | |
| 14 | 1 | my $command = shift; | |
| 15 | 1 | my $headers = shift; | |
| 16 | 1 | my $body = shift; | |
| 17 | |||
| 18 | 1 | my $self = bless {}, $class; | |
| 19 | |||
| 20 | 1 | $self->{command} = $command; | |
| 21 | 1 | $self->{headers} = $headers; | |
| 22 | 1 | $self->{body} = $body; | |
| 23 | |||
| 24 | 1 | return $self; | |
| 25 | } | ||
| 26 | |||
| 27 | # Generate getters | ||
| 28 | { | ||
| 29 | 5 | ▶ | no strict qw( refs ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | |||
| 31 | 5 | foreach my $name ( qw( command headers body ) ) | |
| 32 | { | ||
| 33 | 15 | ▶ | *{$name} = sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 34 | 0 | my $self = shift; | |
| 35 | 0 | return $self->{$name}; | |
| 36 | } | ||
| 37 | 15 | } | |
| 38 | } | ||
| 39 | |||
| 40 | 5 | 1; | |
| 41 | __END__ | ||