line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Nogizaka46; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
156151
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
103
|
|
4
|
4
|
|
|
4
|
|
15
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
100
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
11
|
use Carp qw(croak); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
211
|
|
7
|
4
|
|
|
4
|
|
1467
|
use DateTime; |
|
4
|
|
|
|
|
147936
|
|
|
4
|
|
|
|
|
1943
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.2'; |
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
|
32
|
my $class = shift; |
80
|
3
|
|
|
|
|
11
|
my $self = bless {members => []}, $class; |
81
|
|
|
|
|
|
|
|
82
|
3
|
|
|
|
|
12
|
$self->_initialize; |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
9
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub members { |
88
|
10
|
|
|
10
|
1
|
2556
|
my ($self, $type, @members) = @_; |
89
|
10
|
50
|
|
|
|
28
|
@members = @{$self->{members}} unless @members; |
|
10
|
|
|
|
|
84
|
|
90
|
|
|
|
|
|
|
|
91
|
10
|
100
|
|
|
|
47
|
return @members unless $type; |
92
|
|
|
|
|
|
|
|
93
|
6
|
100
|
|
|
|
170
|
if ($type eq 'active') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
94
|
1
|
|
|
|
|
2
|
return grep {!$_->graduate_date} @members; |
|
51
|
|
|
|
|
591
|
|
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
elsif ($type eq 'graduate') { |
97
|
1
|
|
|
|
|
3
|
return grep {$_->graduate_date} @members; |
|
51
|
|
|
|
|
355
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
elsif ($type->isa('DateTime')) { |
100
|
|
|
|
|
|
|
return grep { |
101
|
4
|
100
|
100
|
|
|
236
|
$date_joined{$_->class} <= $type and |
|
204
|
|
|
|
|
15823
|
|
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
|
652
|
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
|
|
|
|
|
20
|
|
125
|
|
|
|
|
|
|
|
126
|
2
|
50
|
|
|
|
8
|
@members = $self->members unless @members; |
127
|
2
|
100
|
|
|
|
11
|
if ($type eq 'center') { |
128
|
|
|
|
|
|
|
} else { |
129
|
1
|
|
|
|
|
73
|
my $compare = eval "(sub { \$num_or_str $operator \$_[0] })"; |
130
|
|
|
|
|
|
|
|
131
|
1
|
|
|
|
|
3
|
return grep { $compare->($_->$type) } @members; |
|
51
|
|
|
|
|
126
|
|
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub _initialize { |
136
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
137
|
|
|
|
|
|
|
|
138
|
3
|
|
|
|
|
7
|
for my $member (@members) { |
139
|
153
|
|
|
|
|
241
|
my $module_name = 'Acme::Nogizaka46::'.$member; |
140
|
|
|
|
|
|
|
|
141
|
153
|
|
|
|
|
7811
|
eval qq|require $module_name;|; |
142
|
153
|
|
|
|
|
359
|
push @{$self->{members}}, $module_name->new; |
|
153
|
|
|
|
|
849
|
|
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
3
|
|
|
|
|
6
|
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__ |