| 1 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | # Copyright (C) 2015 Christian Garbs <mitch@cgarbs.de> | ||||||||||
| 4 | # Licensed under GNU GPL v2 or later. | ||||||||||
| 5 | |||||||||||
| 6 | package Net::Fritz::Data; | ||||||||||
| 7 | # ABSTRACT: wraps various response data | ||||||||||
| 8 | 6 | $Net::Fritz::Data::VERSION = 'v0.0.9'; | |||||||||
| 9 | |||||||||||
| 10 | 6 | ▶ | use Scalar::Util qw(blessed); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 6 | with 'Net::Fritz::IsNoError'; | |||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 6 | has data => ( is => 'ro' ); | |||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | # prepend 'data => ' when called without hash | ||||||||||
| 21 | # (when called with uneven list) | ||||||||||
| 22 | 14 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 23 | 14 | my ( $class, @args ) = @_; | |||||||||
| 24 | |||||||||||
| 25 | 14 | ▶ | unshift @args, "data" if @args % 2 == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 14 | return { @args }; | |||||||||
| 28 | }; | ||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | sub get { | ||||||||
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 32 | 1 | my $self = shift; | |||||||||
| 33 | |||||||||||
| 34 | 1 | return $self->data; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 2 | ▶ | sub dump { | ||||||||
|
Subroutine
dump: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 39 | 2 | my $self = shift; | |||||||||
| 40 | |||||||||||
| 41 | 2 | my $indent = shift; | |||||||||
| 42 | 2 | ▶ | $indent = '' unless defined $indent; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | |||||||||||
| 44 | 2 | my $text = "${indent}" . blessed( $self ) . ":\n"; | |||||||||
| 45 | 2 | $text .= "${indent}----data----\n"; | |||||||||
| 46 | 2 | $text .= $self->data . "\n"; | |||||||||
| 47 | 2 | $text .= "------------\n"; | |||||||||
| 48 | |||||||||||
| 49 | 2 | return $text; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | |||||||||||
| 53 | 6 | 1; | |||||||||
| 54 | |||||||||||
| 55 | __END__ | ||||||||||