| 1 | package Geo::TigerLine::Record; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | $VERSION = '0.01'; | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | =pod | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | =head1 NAME | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | Geo::TigerLine::Record - Superclass for all TIGER/Line record classes. | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | package Geo::TigerLine::Record::42; | ||||||||||||||||||||
| 17 | use base qw(Geo::TigerLine::Record); | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | $record = __PACKAGE__->new(\%fields); | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | =head1 DESCRIPTION | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | From this class all the specific TIGER/Line record classes inherit. | ||||||||||||||||||||
| 25 | It provides some of the basic methods common to all records. | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | You shouldn't be here. | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head2 Methods | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | =over 4 | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | =item B<new> | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | $record = __PACKAGE__->new(\%fields); | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | A simple constructor. Each field is passed through its accessor and | ||||||||||||||||||||
| 38 | sanity checked. | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | =cut | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | #'# | ||||||||||||||||||||
| 43 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 44 | 0 | my($proto, $fields) = @_; | |||||||||||||||||||
| 45 | 0 | ▶ | my($class) = ref $proto || $proto; | ||||||||||||||||||
|
Condition0%0/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | my $self = []; | |||||||||||||||||||
| 48 | 0 | bless $self, $class; | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 0 | ▶ | while( my($k,$v) = each %$fields ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 51 | 0 | $self->$k($v); | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | warn "inside ", __PACKAGE__, "->new = $self\n"; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 0 | return $self; | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | =pod | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | =back | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | =head1 AUTHOR | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | Michael G Schwern <schwern@pobox.com> | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | =head1 SEE ALSO | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | L<Geo::TigerLine> | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | =cut | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 1 | 1; | |||||||||||||||||||