| 1 | package Book::Bilingual::Chapter; | ||||||||||||||
| 2 | # ABSTRACT: A book chapter class | ||||||||||||||
| 3 | 4 | ▶ | use Mojo::Base -base; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 4 | ▶ | use Carp; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 4 | has 'number'; | |||||||||||||
| 7 | 4 | has 'title'; | |||||||||||||
| 8 | 4 | has 'body'; | |||||||||||||
| 9 | |||||||||||||||
| 10 | 48 | ▶ | sub new { $_[0]->SUPER::new({ body => [] }) } | ||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 11 | sub num_paragraphs { | ||||||||||||||
| 12 | 1 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
num_paragraphs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 13 | |||||||||||||||
| 14 | 1 | return scalar @{$self->{body}}; | |||||||||||||
| 15 | } | ||||||||||||||
| 16 | sub dlineset_at { ## ($i) :> Dlineset | ||||||||||||||
| 17 | 9 | ▶ | my ($self,$i) = @_; | ||||||||||||
|
Subroutine
dlineset_at: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 18 | 9 | ▶ | return $self->number if $i == 0; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 19 | 7 | ▶ | return $self->title if $i == 1; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 20 | 5 | return $self->body->[$i-2]; | |||||||||||||
| 21 | } | ||||||||||||||
| 22 | sub dlineset_count { | ||||||||||||||
| 23 | 7 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
dlineset_count: called CC=3 SCAR=11.7
Pod
undocumented
| |||||||||||||||
| 24 | |||||||||||||||
| 25 | return (defined $self->number ? 1 : 0) | ||||||||||||||
| 26 | + (defined $self->title ? 1 : 0) | ||||||||||||||
| 27 | 7 | ▶ | + scalar @{$self->{body}}; | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 28 | } | ||||||||||||||
| 29 | |||||||||||||||
| 30 | 4 | 1; | |||||||||||||