File Coverage

blib/lib/WWW/Connpass/Event.pm
Criterion Covered Total %
statement 9 62 14.5
branch n/a
condition 0 8 0.0
subroutine 3 43 6.9
pod 0 40 0.0
total 12 153 7.8


line stmt bran cond sub pod time code
1             package WWW::Connpass::Event;
2 1     1   4 use strict;
  1         1  
  1         25  
3 1     1   3 use warnings;
  1         2  
  1         20  
4              
5 1     1   315 use WWW::Connpass::Event::Waitlist;
  1         1  
  1         606  
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 update_waitlist_count {
62 0     0 0   my $self = shift;
63 0           $self->{session}->update_waitlist_count($self, @_);
64             }
65              
66             sub set_place {
67 0     0 0   my ($self, $place) = @_;
68 0           $self->edit(place => $place->id);
69             }
70              
71             sub set_group {
72 0     0 0   my ($self, $group) = @_;
73 0           $self->edit(series => $group->id);
74             }
75              
76             sub add_owner {
77 0     0 0   my ($self, $user) = @_;
78 0           $self->{session}->add_owner_to_event($self, $user);
79             }
80              
81             sub questionnaire {
82 0     0 0   my $self = shift;
83 0   0       return $self->{questionnaire} ||= $self->{session}->fetch_questionnaire_by_event($self);
84             }
85              
86             sub participants {
87 0     0 0   my $self = shift;
88 0   0       return $self->{participants} ||= $self->{session}->fetch_participants_info($self);
89             }
90              
91             sub refetch {
92 0     0 0   my $self = shift;
93 0           $self->{session}->refetch_event($self);
94             }
95              
96             1;
97             __END__