| 1 | package Weather::Com::AirPressure; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 2 | ▶ | use 5.006; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 2 | ▶ | use Weather::Com::L10N; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 2 | ▶ | use base 'Weather::Com::Object'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 2 | our $VERSION = sprintf "%d.%03d", q$Revision: 1.10 $ =~ /(\d+)/g; | |||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 12 | # Constructor | ||||||||||||||||||||
| 13 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 14 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.9
Pod
undocumented
| |||||||||||||||||||||
| 15 | 2 | my $proto = shift; | |||||||||||||||||||
| 16 | 2 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 17 | 2 | my %parameters; | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | # parameters provided by new method | ||||||||||||||||||||
| 20 | 2 | ▶ | if ( ref( $_[0] ) eq "HASH" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | 0 | %parameters = %{ $_[0] }; | |||||||||||||||||||
| 22 | } else { | ||||||||||||||||||||
| 23 | 2 | %parameters = @_; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 2 | my $self = $class->SUPER::new( \%parameters ); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | # getting first weather information | ||||||||||||||||||||
| 29 | 2 | $self->{PRESSURE} = -1; | |||||||||||||||||||
| 30 | 2 | $self->{TENDENCY} = 'unknown'; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 2 | return $self; | |||||||||||||||||||
| 33 | } # end new() | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 36 | # update barometric data | ||||||||||||||||||||
| 37 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 38 | 2 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||
| 39 | 2 | my $self = shift; | |||||||||||||||||||
| 40 | 2 | my %bar; | |||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 2 | ▶ | if ( ref( $_[0] ) eq "HASH" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | 0 | %bar = %{ $_[0] }; | |||||||||||||||||||
| 44 | } else { | ||||||||||||||||||||
| 45 | 2 | %bar = @_; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 2 | ▶ | unless ( $bar{r} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | 1 | $self->{PRESSURE} = -1; | |||||||||||||||||||
| 50 | } else { | ||||||||||||||||||||
| 51 | 1 | $self->{PRESSURE} = lc( $bar{r} ); | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | 2 | ▶ | unless ( $bar{d} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 54 | 1 | $self->{TENDENCY} = "unknown"; | |||||||||||||||||||
| 55 | } else { | ||||||||||||||||||||
| 56 | 1 | $self->{TENDENCY} = lc( $bar{d} ); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 2 | return 1; | |||||||||||||||||||
| 60 | } | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 63 | # access moon data | ||||||||||||||||||||
| 64 | #------------------------------------------------------------------------ | ||||||||||||||||||||
| 65 | 4 | ▶ | sub pressure { | ||||||||||||||||||
|
Subroutine
pressure: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 66 | 4 | my $self = shift; | |||||||||||||||||||
| 67 | 4 | return $self->{PRESSURE}; | |||||||||||||||||||
| 68 | } | ||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 4 | ▶ | sub tendency { | ||||||||||||||||||
|
Subroutine
tendency: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 71 | 4 | my $self = shift; | |||||||||||||||||||
| 72 | 4 | my $language = shift; | |||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 4 | return $self->get_language_handle($language)->maketext(lc($self->{TENDENCY}) ); | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 2 | 1; | |||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | __END__ | ||||||||||||||||||||