File Coverage

blib/lib/Data/Phrasebook/Loader/Base.pm
Criterion Covered Total %
statement 27 27 100.0
branch 2 2 100.0
condition n/a
subroutine 11 11 100.0
pod 6 6 100.0
total 46 46 100.0


line stmt bran cond sub pod time code
1             package Data::Phrasebook::Loader::Base;
2 12     12   77527 use strict;
  12         24  
  12         467  
3 12     12   61 use warnings FATAL => 'all';
  12         25  
  12         445  
4 12     12   64 use base qw( Data::Phrasebook::Debug );
  12         21  
  12         1251  
5 12     12   72 use Carp qw( croak );
  12         40  
  12         842  
6              
7 12     12   69 use vars qw($VERSION);
  12         74  
  12         3479  
8             $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 acts as a base class for phrasebook
21             plugins.
22              
23             =cut
24              
25             my $something = 0;
26              
27             =head1 CONSTRUCTOR
28              
29             =head2 new
30              
31             C instantiates the plugin object, creating a blessed hash of any
32             attributes passed as arguments.
33              
34             =cut
35              
36             sub new {
37 27     27 1 644 my $self = shift;
38 27         124 my %hash = @_;
39 27         212 ($hash{class}) = $self =~ /.*::(.*)$/;
40 27 100       169 $self->store(3,"$self->new IN") if($self->debug);
41 27         63 my $atts = \%hash;
42 27         495 bless $atts, $self;
43 27         222 return $atts;
44             }
45              
46             =head1 INHERITABLE METHODS
47              
48             =head2 load
49              
50             C is an abstract method here. You must define your own in your
51             subclass. Loads the phrasebook.
52              
53             =head2 get
54              
55             C is an abstract method here. You must define your own in your
56             subclass. Gets the phrase.
57              
58             =head2 dicts
59              
60             C 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 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 of loader.
71              
72             =cut
73              
74 1     1 1 5 sub load { return }
75 1     1 1 5 sub get { return }
76 1     1 1 8 sub dicts { return () }
77 1     1 1 5 sub keywords { return () }
78 54     54 1 1694 sub class { return shift->{class} }
79              
80             1;
81              
82             __END__