Phrasebook/Loader/Base.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 6 / 6 totaltotal 100% 49 / 49 CC 2 SCAR 1.5
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Phrasebook/Debug.pm ↑ Summary
1 package Data::Phrasebook::Loader::Base;
2 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 12 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use base qw( Data::Phrasebook::Debug );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 $VERSION = '0.35';
9  
10 =head1 NAME
11  
12 Data::Phrasebook::Loader::Base - Base loader plugin class.
13  
14 =head1 SYNOPSIS
15  
16 $class->new( %attributes );
17  
18 =head1 DESCRIPTION
19  
20 C<Data::Phrasebook::Loader::Base> acts as a base class for phrasebook
21 plugins.
22  
23 =cut
24  
25 12 my $something = 0;
26  
27 =head1 CONSTRUCTOR
28  
29 =head2 new
30  
31 C<new> instantiates the plugin object, creating a blessed hash of any
32 attributes passed as arguments.
33  
34 =cut
35  
36 27 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
37 27 my $self = shift;
38 27 my %hash = @_;
39 27 ($hash{class}) = $self =~ /.*::(.*)$/;
40 27 ▶ $self->store(3,"$self->new IN") if($self->debug);
Branch: 1 branch
BranchTrueFalseTotal
if $self->debug 1 26 27
41 27 my $atts = \%hash;
42 27 bless $atts, $self;
43 27 return $atts;
44 }
45  
46 =head1 INHERITABLE METHODS
47  
48 =head2 load
49  
50 C<load> is an abstract method here. You must define your own in your
51 subclass. Loads the phrasebook.
52  
53 =head2 get
54  
55 C<get> is an abstract method here. You must define your own in your
56 subclass. Gets the phrase.
57  
58 =head2 dicts
59  
60 C<dicts> is an abstract method here. You must define your own in your
61 subclass. Returns the list of dictionaries available.
62  
63 =head2 keywords
64  
65 C<keywords> is an abstract method here. You must define your own in your
66 subclass. Returns the list of keywords available.
67  
68 =head2 class
69  
70 Returns the current C<class> of loader.
71  
72 =cut
73  
74 1 ▶sub load { return }
Subroutine load: called CC=1 SCAR=0.0
Pod documented
75 1 ▶sub get { return }
Subroutine get: called CC=1 SCAR=0.0
Pod documented
76 1 ▶sub dicts { return () }
Subroutine dicts: called CC=1 SCAR=0.0
Pod documented
77 1 ▶sub keywords { return () }
Subroutine keywords: called CC=1 SCAR=0.0
Pod documented
78 54 ▶sub class { return shift->{class} }
Subroutine class: called CC=1 SCAR=0.0
Pod documented
79  
80 12 1;
81  
82 __END__
« Phrasebook/Debug.pm ↑ Summary