| 1 | package HTML::ListScraper::Dust; | ||||||||||
| 2 | |||||||||||
| 3 | 10 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 10 | ▶ | use Class::Generate qw(class); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 10 | class 'HTML::ListScraper::Alignment' => { | |||||||||
| 9 | score => { type => '$', required => 1 }, | ||||||||||
| 10 | positions => { type => '@', required => 1 } | ||||||||||
| 11 | }; | ||||||||||
| 12 | |||||||||||
| 13 | 88 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 14 | 88 | my $class = shift; | |||||||||
| 15 | 88 | my $self = { align => [] }; | |||||||||
| 16 | 88 | bless $self, $class; | |||||||||
| 17 | |||||||||||
| 18 | 88 | return $self; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 44 | ▶ | sub add_alignment { | ||||||||
|
Subroutine
add_alignment: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 22 | 44 | my ($self, $score, $pos) = @_; | |||||||||
| 23 | |||||||||||
| 24 | 44 | push @{$self->{align}}, | |||||||||
| 25 | HTML::ListScraper::Alignment->new(score => $score, | ||||||||||
| 26 | positions => $pos); | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 38 | ▶ | sub add_alignments_before { | ||||||||
|
Subroutine
add_alignments_before: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | 38 | my ($self, $alignments) = @_; | |||||||||
| 31 | |||||||||||
| 32 | 38 | unshift @{$self->{align}}, @$alignments; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 22 | ▶ | sub add_alignments_after { | ||||||||
|
Subroutine
add_alignments_after: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 36 | 22 | my ($self, $alignments) = @_; | |||||||||
| 37 | |||||||||||
| 38 | 22 | push @{$self->{align}}, @$alignments; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 88 | ▶ | sub get_alignments { | ||||||||
|
Subroutine
get_alignments: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 42 | 88 | my $self = shift; | |||||||||
| 43 | |||||||||||
| 44 | 88 | ▶ | return wantarray ? @{$self->{align}} : $self->{align}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 10 | 1; | |||||||||