| 1 | package JSAN::Librarian::Book; | ||||||||||
| 2 | |||||||||||
| 3 | # Implements a JavaScript::Librarian::Book. In our case, the id IS the path | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Params::Util '_HASH0'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use JavaScript::Librarian::Book; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use vars qw{$VERSION @ISA}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | $VERSION = '0.03'; | |||||||||
| 12 | 2 | @ISA = 'JavaScript::Librarian::Book'; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | ##################################################################### | ||||||||||
| 20 | # Constructor | ||||||||||
| 21 | |||||||||||
| 22 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||
| 23 | 3 | my $class = shift; | |||||||||
| 24 | 3 | ▶ | my $path = shift or return undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 3 | ▶ | my $deps = _HASH0(shift) or return undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | # Create the object | ||||||||||
| 28 | 3 | my $self = bless { | |||||||||
| 29 | id => $path, | ||||||||||
| 30 | depends => [ keys %$deps ], | ||||||||||
| 31 | }, $class; | ||||||||||
| 32 | |||||||||||
| 33 | 3 | $self; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 3 | ▶ | sub path { $_[0]->{id} } | ||||||||
|
Subroutine
path: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 37 | |||||||||||
| 38 | 2 | 1; | |||||||||