| 1 | package Reddit::Client::VotableThing; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 5 | require Reddit::Client::Thing; | |||||||||
| 8 | |||||||||||
| 9 | 5 | ▶ | use base qw/Reddit::Client::Thing/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 5 | ▶ | use fields qw/ups downs likes score edited type is_original_content/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | # likes may be true, false, or null, based on user vote | ||||||||||
| 13 | 0 | ▶ | sub set_likes { | ||||||||
|
Subroutine
set_likes: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 14 | 0 | my ($self, $value) = @_; | |||||||||
| 15 | 0 | ▶ | $self->set_bool('likes', $value) if defined $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub vote { | ||||||||
|
Subroutine
vote: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | 0 | my ($self, $direction) = @_; | |||||||||
| 20 | 0 | $self->{session}->vote($self->{name}, $direction); | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub comment { | ||||||||
|
Subroutine
comment: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | 0 | my ($self, $comment) = @_; | |||||||||
| 25 | 0 | $self->{session}->submit_comment(parent_id => $self->{name}, text => $comment); | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub save { | ||||||||
|
Subroutine
save: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | 0 | my $self = shift; | |||||||||
| 30 | 0 | $self->{session}->save($self->{name}); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub unsave { | ||||||||
|
Subroutine
unsave: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 0 | my $self = shift; | |||||||||
| 35 | 0 | $self->{session}->unsave($self->{name}); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 5 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||