line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Net::Songkick::Event - Models an event in the Songkick API |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=cut |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Net::Songkick::Event; |
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
36
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
158
|
|
10
|
5
|
|
|
5
|
|
29
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
132
|
|
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
|
23
|
use Moose; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
35
|
|
13
|
5
|
|
|
5
|
|
35571
|
use DateTime; |
|
5
|
|
|
|
|
1877019
|
|
|
5
|
|
|
|
|
235
|
|
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
2477
|
use Net::Songkick::Types; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
219
|
|
16
|
5
|
|
|
5
|
|
2679
|
use Net::Songkick::Location; |
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
224
|
|
17
|
5
|
|
|
5
|
|
2805
|
use Net::Songkick::Performance; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
235
|
|
18
|
5
|
|
|
5
|
|
2763
|
use Net::Songkick::Venue; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
1219
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has $_ => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => 'Str', |
23
|
|
|
|
|
|
|
) for qw(type status uri displayName popularity id ageRestriction); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has location => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => 'Net::Songkick::Location', |
28
|
|
|
|
|
|
|
coerce => 1, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has performance => ( |
32
|
|
|
|
|
|
|
is => 'ro', |
33
|
|
|
|
|
|
|
isa => 'ArrayRef[Net::Songkick::Performance]', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
has start => ( |
37
|
|
|
|
|
|
|
is => 'ro', |
38
|
|
|
|
|
|
|
isa => 'Net::Songkick::DateTime', |
39
|
|
|
|
|
|
|
coerce => 1, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has end => ( |
43
|
|
|
|
|
|
|
is => 'ro', |
44
|
|
|
|
|
|
|
isa => 'Net::Songkick::DateTime', |
45
|
|
|
|
|
|
|
coerce => 1, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
has venue => ( |
49
|
|
|
|
|
|
|
is => 'ro', |
50
|
|
|
|
|
|
|
isa => 'Net::Songkick::Venue', |
51
|
|
|
|
|
|
|
coerce => 1, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
around BUILDARGS => sub { |
55
|
|
|
|
|
|
|
my $orig = shift; |
56
|
|
|
|
|
|
|
my $class = shift; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my %args; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
if (@_ == 1) { |
61
|
|
|
|
|
|
|
%args = %{$_[0]}; |
62
|
|
|
|
|
|
|
} else { |
63
|
|
|
|
|
|
|
%args = @_; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
if (exists $args{start} and not $args{start}) { |
67
|
|
|
|
|
|
|
$args{start} = DateTime->new_from_epoch(epoch => 0); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
if (exists $args{performance}) { |
71
|
|
|
|
|
|
|
foreach (@{$args{performance}}) { |
72
|
|
|
|
|
|
|
if (ref $_ ne 'Net::Songkick::Performance') { |
73
|
|
|
|
|
|
|
$_ = Net::Songkick::Performance->new($_); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$class->$orig(\%args); |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
5
|
|
|
5
|
|
43
|
no Moose; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
33
|
|
82
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Dave Cross <dave@perlhacks.com> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SEE ALSO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
perl(1), L<http://www.songkick.com/>, L<http://developer.songkick.com/> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Copyright (C) 2010, Magnum Solutions Ltd. All Rights Reserved. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This script is free software; you can redistribute it and/or modify it |
97
|
|
|
|
|
|
|
under the same terms as Perl itself. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; |