line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Nogizaka46; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
267721
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
113
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
121
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
19
|
use Carp qw(croak); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
232
|
|
7
|
4
|
|
|
4
|
|
2764
|
use DateTime; |
|
4
|
|
|
|
|
249469
|
|
|
4
|
|
|
|
|
2853
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.0.1'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @members = qw( |
12
|
|
|
|
|
|
|
AkimotoManatsu |
13
|
|
|
|
|
|
|
AndoMikumo |
14
|
|
|
|
|
|
|
IkutaErika |
15
|
|
|
|
|
|
|
IkomaRina |
16
|
|
|
|
|
|
|
IchikiRena |
17
|
|
|
|
|
|
|
ItoNene |
18
|
|
|
|
|
|
|
ItoMarika |
19
|
|
|
|
|
|
|
InoueSayuri |
20
|
|
|
|
|
|
|
IwaseYumiko |
21
|
|
|
|
|
|
|
EtoMisa |
22
|
|
|
|
|
|
|
KashiwaYukina |
23
|
|
|
|
|
|
|
KawagoHina |
24
|
|
|
|
|
|
|
KawamuraMahiro |
25
|
|
|
|
|
|
|
SaitoAsuka |
26
|
|
|
|
|
|
|
SaitoChiharu |
27
|
|
|
|
|
|
|
SaitoYuri |
28
|
|
|
|
|
|
|
SakuraiReika |
29
|
|
|
|
|
|
|
ShiraishiMai |
30
|
|
|
|
|
|
|
TakayamaKazumi |
31
|
|
|
|
|
|
|
NakadaKana |
32
|
|
|
|
|
|
|
NakamotoHimeka |
33
|
|
|
|
|
|
|
NagashimaSeira |
34
|
|
|
|
|
|
|
NishinoNanase |
35
|
|
|
|
|
|
|
NojoAmi |
36
|
|
|
|
|
|
|
HashimotoNanami |
37
|
|
|
|
|
|
|
HatanakaSeira |
38
|
|
|
|
|
|
|
HiguchiHina |
39
|
|
|
|
|
|
|
FukagawaMai |
40
|
|
|
|
|
|
|
HoshinoMinami |
41
|
|
|
|
|
|
|
MatsumuraSayuri |
42
|
|
|
|
|
|
|
MiyazawaSeira |
43
|
|
|
|
|
|
|
YamatoRina |
44
|
|
|
|
|
|
|
YamamotoHonoka |
45
|
|
|
|
|
|
|
YoshimotoAyaka |
46
|
|
|
|
|
|
|
WakatsukiYumi |
47
|
|
|
|
|
|
|
WadaMaaya |
48
|
|
|
|
|
|
|
ItoKarin |
49
|
|
|
|
|
|
|
ItoJunna |
50
|
|
|
|
|
|
|
KitanoHinako |
51
|
|
|
|
|
|
|
SagaraIori |
52
|
|
|
|
|
|
|
SasakiKotoko |
53
|
|
|
|
|
|
|
ShinuchiMai |
54
|
|
|
|
|
|
|
SuzukiAyane |
55
|
|
|
|
|
|
|
TeradaRanze |
56
|
|
|
|
|
|
|
NishikawaNanami |
57
|
|
|
|
|
|
|
HoriMiona |
58
|
|
|
|
|
|
|
YadaRisako |
59
|
|
|
|
|
|
|
YamazakiRena |
60
|
|
|
|
|
|
|
YonetokuKyoka |
61
|
|
|
|
|
|
|
WatanabeMiria |
62
|
|
|
|
|
|
|
MatsuiRena |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my %date_joined = map { |
66
|
|
|
|
|
|
|
my ($class, $year, $month, $day) = ($_ =~ /(\w+):(\d{4})-(\d{2})-(\d{2})/); |
67
|
|
|
|
|
|
|
$class => DateTime->new( |
68
|
|
|
|
|
|
|
year => $year, |
69
|
|
|
|
|
|
|
month => $month, |
70
|
|
|
|
|
|
|
day => $day, |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
} qw( |
73
|
|
|
|
|
|
|
1:2011-08-21 |
74
|
|
|
|
|
|
|
2:2013-05-11 |
75
|
|
|
|
|
|
|
MatsuiRena:2014-02-24 |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub new { |
79
|
3
|
|
|
3
|
1
|
37
|
my $class = shift; |
80
|
3
|
|
|
|
|
15
|
my $self = bless {members => []}, $class; |
81
|
|
|
|
|
|
|
|
82
|
3
|
|
|
|
|
15
|
$self->_initialize; |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
14
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub members { |
88
|
9
|
|
|
9
|
1
|
1543
|
my ($self, $type, @members) = @_; |
89
|
9
|
50
|
|
|
|
33
|
@members = @{$self->{members}} unless @members; |
|
9
|
|
|
|
|
103
|
|
90
|
|
|
|
|
|
|
|
91
|
9
|
100
|
|
|
|
66
|
return @members unless $type; |
92
|
|
|
|
|
|
|
|
93
|
5
|
100
|
|
|
|
134
|
if ($type eq 'active') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
94
|
1
|
|
|
|
|
3
|
return grep {!$_->graduate_date} @members; |
|
51
|
|
|
|
|
981
|
|
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
elsif ($type eq 'graduate') { |
97
|
1
|
|
|
|
|
3
|
return grep {$_->graduate_date} @members; |
|
51
|
|
|
|
|
647
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
elsif ($type->isa('DateTime')) { |
100
|
|
|
|
|
|
|
return grep { |
101
|
3
|
100
|
100
|
|
|
204
|
$date_joined{$_->class} <= $type and |
|
153
|
|
|
|
|
14474
|
|
102
|
|
|
|
|
|
|
(!$_->graduate_date or $type <= $_->graduate_date) |
103
|
|
|
|
|
|
|
} @members; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub sort { |
108
|
0
|
|
|
0
|
1
|
0
|
my ($self, $type, $order, @members) = @_; |
109
|
0
|
0
|
|
|
|
0
|
@members = $self->members unless @members; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# order by desc if $order is true |
112
|
0
|
0
|
|
|
|
0
|
if ($order) { |
113
|
0
|
|
|
|
|
0
|
return sort {$b->$type <=> $a->$type} @members; |
|
0
|
|
|
|
|
0
|
|
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
else { |
116
|
0
|
|
|
|
|
0
|
return sort {$a->$type <=> $b->$type} @members; |
|
0
|
|
|
|
|
0
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub select { |
121
|
2
|
|
|
2
|
1
|
520
|
my ($self, $type, $num_or_str, $operator, @members) = @_; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
$self->_die('invalid operator was passed in') |
124
|
2
|
50
|
|
|
|
4
|
unless grep {$operator eq $_} qw(== >= <= > < eq ne); |
|
14
|
|
|
|
|
34
|
|
125
|
|
|
|
|
|
|
|
126
|
2
|
50
|
|
|
|
10
|
@members = $self->members unless @members; |
127
|
2
|
100
|
|
|
|
14
|
if ($type eq 'center') { |
128
|
|
|
|
|
|
|
} else { |
129
|
1
|
|
|
|
|
89
|
my $compare = eval "(sub { \$num_or_str $operator \$_[0] })"; |
130
|
|
|
|
|
|
|
|
131
|
1
|
|
|
|
|
4
|
return grep { $compare->($_->$type) } @members; |
|
51
|
|
|
|
|
175
|
|
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub _initialize { |
136
|
3
|
|
|
3
|
|
8
|
my $self = shift; |
137
|
|
|
|
|
|
|
|
138
|
3
|
|
|
|
|
25
|
for my $member (@members) { |
139
|
153
|
|
|
|
|
336
|
my $module_name = 'Acme::Nogizaka46::'.$member; |
140
|
|
|
|
|
|
|
|
141
|
153
|
|
|
|
|
9856
|
eval qq|require $module_name;|; |
142
|
153
|
|
|
|
|
515
|
push @{$self->{members}}, $module_name->new; |
|
153
|
|
|
|
|
1160
|
|
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
3
|
|
|
|
|
10
|
return 1; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub _die { |
149
|
0
|
|
|
0
|
|
|
my ($self, $message) = @_; |
150
|
0
|
|
|
|
|
|
Carp::croak($message); |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
1; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
__END__ |