| 1 | package DMOSS::Attr; | ||||||||||
| 2 | # ABSTRACT: DMOSS attribute object | ||||||||||
| 3 | 3 | $DMOSS::Attr::VERSION = '0.01_2'; | |||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=7 SCAR=21.0
Pod
documented
| |||||||||||
| 8 | 1 | my ($class, $file, $plugin, $name, $value) = @_; | |||||||||
| 9 | 1 | my $self = bless({}, $class); | |||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | $self->file($file) if $file; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 1 | ▶ | $self->plugin($plugin) if $plugin; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 1 | ▶ | $self->name($name) if $name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 1 | ▶ | $self->value($value) if $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 1 | ▶ | $self->value({}) unless $self->value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 1 | ▶ | $self->type(ref($value)) if $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | return $self; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub file { | ||||||||
|
Subroutine
file: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 22 | 0 | my ($self, $file) = @_; | |||||||||
| 23 | 0 | ▶ | $self->{file} = $file if $file; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | return $self->{file}; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub plugin { | ||||||||
|
Subroutine
plugin: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 29 | 0 | my ($self, $plugin) = @_; | |||||||||
| 30 | 0 | ▶ | $self->{plugin} = $plugin if $plugin; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | 0 | return $self->{plugin}; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub name { | ||||||||
|
Subroutine
name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 36 | 0 | my ($self, $name) = @_; | |||||||||
| 37 | 0 | ▶ | $self->{name} = $name if $name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | |||||||||||
| 39 | 0 | return $self->{name}; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 2 | ▶ | sub value { | ||||||||
|
Subroutine
value: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 43 | 2 | my ($self, $value) = @_; | |||||||||
| 44 | 2 | ▶ | $self->{value} = $value if $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | |||||||||||
| 46 | 2 | return $self->{value}; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 0 | ▶ | sub type { | ||||||||
|
Subroutine
type: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 50 | 0 | my ($self, $type) = @_; | |||||||||
| 51 | 0 | ▶ | $self->{type} = $type if $type; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | |||||||||||
| 53 | 0 | return $self->{type}; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 3 | 1; | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||