File Coverage

blib/lib/WWW/Connpass/Event.pm
Criterion Covered Total %
statement 9 65 13.8
branch n/a
condition 0 10 0.0
subroutine 3 44 6.8
pod 0 41 0.0
total 12 160 7.5


line stmt bran cond sub pod time code
1             package WWW::Connpass::Event;
2 1     1   5 use strict;
  1         2  
  1         22  
3 1     1   4 use warnings;
  1         1  
  1         18  
4              
5 1     1   321 use WWW::Connpass::Event::Waitlist;
  1         2  
  1         743  
6              
7             sub new {
8 0     0 0   my ($class, %args) = @_;
9 0           return bless {
10             %args,
11             waitlist_count => [],
12             } => $class;
13             }
14              
15             sub edit {
16 0     0 0   my ($self, %diff) = @_;
17 0           $self->{session}->update_event($self, \%diff);
18             }
19              
20 0     0 0   sub raw_data { shift->{event} }
21              
22             # getter
23 0     0 0   sub cancel_policy { shift->{event}->{cancel_policy} }
24 0     0 0   sub cancelled_count { shift->{event}->{cancelled_count} }
25 0     0 0   sub contact_details { shift->{event}->{contact_details} }
26 0     0 0   sub description { shift->{event}->{description} }
27 0     0 0   sub description_input { shift->{event}->{description_input} }
28 0     0 0   sub end_datetime { shift->{event}->{end_datetime} }
29 0     0 0   sub event_type { shift->{event}->{event_type} }
30 0     0 0   sub hashtag { shift->{event}->{hashtag} }
31 0     0 0   sub id { shift->{event}->{id} }
32 0     0 0   sub image { shift->{event}->{image} }
33 0     0 0   sub issue_ticket { shift->{event}->{issue_ticket} }
34 0     0 0   sub lottery_publish_date { shift->{event}->{lottery_publish_date} }
35 0     0 0   sub lottery_publish_notification_sent { shift->{event}->{lottery_publish_notification_sent} }
36 0     0 0   sub max_num { shift->{event}->{max_num} }
37 0     0 0   sub open_end_datetime { shift->{event}->{open_end_datetime} }
38 0     0 0   sub open_start_datetime { shift->{event}->{open_start_datetime} }
39 0     0 0   sub owner_text { shift->{event}->{owner_text} }
40 0     0 0   sub participants_count { shift->{event}->{participants_count} }
41 0     0 0   sub participation_types { shift->{event}->{participation_types} }
42 0     0 0   sub paypal_email { shift->{event}->{paypal_email} }
43 0     0 0   sub place { shift->{event}->{place} }
44 0     0 0   sub presenter_title { shift->{event}->{presenter_title} }
45 0     0 0   sub public_url { shift->{event}->{public_url} }
46 0     0 0   sub publish_datetime { shift->{event}->{publish_datetime} }
47 0     0 0   sub series { shift->{event}->{series} }
48 0     0 0   sub start_datetime { shift->{event}->{start_datetime} }
49 0     0 0   sub status { shift->{event}->{status} }
50 0     0 0   sub sub_title { shift->{event}->{sub_title} }
51 0     0 0   sub title { shift->{event}->{title} }
52              
53             sub waitlist_count {
54 0     0 0   my $self = shift;
55             my $waitlist_count = $self->{waitlist_count} ||= [
56 0   0       map { WWW::Connpass::Event::Waitlist->new($_) } @{ $self->{event}->{waitlist_count} }
  0            
  0            
57             ];
58 0           return @$waitlist_count;
59             }
60              
61             sub owners {
62 0     0 0   my $self = shift;
63 0   0       my $owners = $self->{owners} ||= [ $self->{session}->fetch_event_owners($self) ];
64 0           return @$owners;
65             }
66              
67             sub update_waitlist_count {
68 0     0 0   my $self = shift;
69 0           $self->{session}->update_waitlist_count($self, @_);
70             }
71              
72             sub set_place {
73 0     0 0   my ($self, $place) = @_;
74 0           $self->edit(place => $place->id);
75             }
76              
77             sub set_group {
78 0     0 0   my ($self, $group) = @_;
79 0           $self->edit(series => $group->id);
80             }
81              
82             sub add_owner {
83 0     0 0   my ($self, $user) = @_;
84 0           $self->{session}->add_owner_to_event($self, $user);
85             }
86              
87             sub questionnaire {
88 0     0 0   my $self = shift;
89 0   0       return $self->{questionnaire} ||= $self->{session}->fetch_questionnaire_by_event($self);
90             }
91              
92             sub participants {
93 0     0 0   my $self = shift;
94 0   0       return $self->{participants} ||= $self->{session}->fetch_participants_info($self);
95             }
96              
97             sub refetch {
98 0     0 0   my $self = shift;
99 0           $self->{session}->refetch_event($self);
100             }
101              
102             1;
103             __END__