| 1 | package Acme::MadokaMagica::TvMembers; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use Mouse; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 3 | ▶ | use Data::Section::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use YAML::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | has has_qb => ( | |||||||||
| 10 | is => 'rw', | ||||||||||
| 11 | isa => 'Bool', | ||||||||||
| 12 | required => 1, | ||||||||||
| 13 | default => 0, | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | 3 | ▶ | no Mouse; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | sub name { | ||||||||||
| 19 | 16 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
name: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||
| 20 | 16 | my $line = (caller)[2]; | |||||||||
| 21 | |||||||||||
| 22 | 16 | my $limit = $self->{startline} +100; | |||||||||
| 23 | 16 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | return undef; | |||||||||
| 25 | } | ||||||||||
| 26 | 16 | ▶ | return $self->has_qb ? $self->{witchename}:$self->lastname . ' ' .$self->firstname; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | sub firstname { | ||||||||||
| 30 | 14 | ▶ | my $self = shift; | ||||||||
|
Subroutine
firstname: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 31 | 14 | my $line = (caller)[2]; | |||||||||
| 32 | |||||||||||
| 33 | 14 | my $limit = $self->{startline} +100; | |||||||||
| 34 | 14 | ▶ | if($line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | return undef; | |||||||||
| 36 | } | ||||||||||
| 37 | 14 | return $self->{firstname}; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub birthday { | ||||||||||
| 41 | 5 | ▶ | my $self = shift; | ||||||||
|
Subroutine
birthday: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 42 | 5 | my $line = (caller)[2]; | |||||||||
| 43 | |||||||||||
| 44 | 5 | my $limit = $self->{startline} +100; | |||||||||
| 45 | 5 | ▶ | if($line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | return undef; | |||||||||
| 47 | } | ||||||||||
| 48 | 5 | return $self->{birthday}; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | sub blood_type { | ||||||||||
| 52 | 5 | ▶ | my $self = shift; | ||||||||
|
Subroutine
blood_type: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 53 | 5 | my $line = (caller)[2]; | |||||||||
| 54 | |||||||||||
| 55 | 5 | my $limit = $self->{startline} +100; | |||||||||
| 56 | 5 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | return undef; | |||||||||
| 58 | } | ||||||||||
| 59 | 5 | return $self->{blood_type}; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | sub lastname { | ||||||||||
| 63 | 14 | ▶ | my $self = shift; | ||||||||
|
Subroutine
lastname: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 64 | 14 | my $line = (caller)[2]; | |||||||||
| 65 | |||||||||||
| 66 | 14 | my $limit = $self->{startline} +100; | |||||||||
| 67 | 14 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | 0 | return undef; | |||||||||
| 69 | } | ||||||||||
| 70 | 14 | return $self->{lastname}; | |||||||||
| 71 | } | ||||||||||
| 72 | |||||||||||
| 73 | sub age { | ||||||||||
| 74 | 5 | ▶ | my $self = shift; | ||||||||
|
Subroutine
age: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 75 | 5 | my $line = (caller)[2]; | |||||||||
| 76 | |||||||||||
| 77 | 5 | my $limit = $self->{startline} +100; | |||||||||
| 78 | 5 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 79 | 0 | return undef; | |||||||||
| 80 | } | ||||||||||
| 81 | 5 | return $self->{age}; | |||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | sub color{ | ||||||||||
| 85 | 13 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
color: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 86 | 13 | my $line = (caller)[2]; | |||||||||
| 87 | |||||||||||
| 88 | 13 | my $limit = $self->{startline} +100; | |||||||||
| 89 | 13 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 90 | 1 | return undef; | |||||||||
| 91 | } | ||||||||||
| 92 | |||||||||||
| 93 | 12 | ▶ | return $self->has_qb ? "black" : $self->{color}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 94 | } | ||||||||||
| 95 | |||||||||||
| 96 | sub qb { | ||||||||||
| 97 | 7 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
qb: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 98 | 7 | my $line = (caller)[2]; | |||||||||
| 99 | |||||||||||
| 100 | 7 | my $limit = $self->{startline} +100; | |||||||||
| 101 | 7 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 102 | 0 | return undef; | |||||||||
| 103 | } | ||||||||||
| 104 | |||||||||||
| 105 | 7 | $self->has_qb(1); | |||||||||
| 106 | } | ||||||||||
| 107 | |||||||||||
| 108 | sub say { | ||||||||||
| 109 | 8 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
say: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 110 | 8 | my $line = (caller)[2]; | |||||||||
| 111 | |||||||||||
| 112 | 8 | my $limit = $self->{startline} +100; | |||||||||
| 113 | 8 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 114 | 0 | return undef; | |||||||||
| 115 | } | ||||||||||
| 116 | 8 | return $self->{say}; | |||||||||
| 117 | } | ||||||||||
| 118 | |||||||||||
| 119 | sub cv { | ||||||||||
| 120 | 5 | ▶ | my $self = shift; | ||||||||
|
Subroutine
cv: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 121 | 5 | my $line = (caller)[2]; | |||||||||
| 122 | |||||||||||
| 123 | 5 | my $limit = $self->{startline} +100; | |||||||||
| 124 | 5 | ▶ | if( $line >= $limit ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 125 | 0 | return undef; | |||||||||
| 126 | } | ||||||||||
| 127 | 5 | return $self->{cv}; | |||||||||
| 128 | } | ||||||||||
| 129 | |||||||||||
| 130 | sub BUILD { | ||||||||||
| 131 | 16 | ▶ | my ($self, $args) = @_; | ||||||||
|
Subroutine
BUILD: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 132 | |||||||||||
| 133 | 16 | my $ds = Data::Section::Simple->new( ref $self ); | |||||||||
| 134 | 16 | my $sections = $ds->get_data_section; | |||||||||
| 135 | 16 | for my $section_name ( keys %{$sections} ) { | |||||||||
| 136 | 16 | my $yml = YAML::Tiny->read_string( $sections->{$section_name} ); | |||||||||
| 137 | 16 | my $member_info = $yml->[0]; | |||||||||
| 138 | 16 | for my $key ( keys %{$member_info} ) { | |||||||||
| 139 | 144 | $self->{$key} = $member_info->{$key}; | |||||||||
| 140 | } | ||||||||||
| 141 | } | ||||||||||
| 142 | 16 | ▶ | if (defined $args->{line}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 143 | 7 | $self->{startline} = $args->{line}; | |||||||||
| 144 | } else { | ||||||||||
| 145 | 9 | $self->{startline} = (caller)[2]; | |||||||||
| 146 | } | ||||||||||
| 147 | } | ||||||||||
| 148 | |||||||||||
| 149 | 3 | 1; | |||||||||