| 1 | package Astro::Nova::LnLatPosn; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use 5.008; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use Astro::Nova; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | # basic stuff is in Astro::Nova's XS! | ||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub members { | ||||||||
|
Subroutine
members: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | 0 | return qw/lng lat/; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | sub as_ascii { | ||||||||
|
Subroutine
as_ascii: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 16 | 0 | my $self = shift; | |||||||||
| 17 | 0 | my $template = <<'HERE'; | |||||||||
| 18 | Longitude: %f | ||||||||||
| 19 | Latitude: %f | ||||||||||
| 20 | HERE | ||||||||||
| 21 | 0 | return sprintf($template, $self->get_all()); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub get_all { | ||||||||
|
Subroutine
get_all: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 25 | 0 | my $self = shift; | |||||||||
| 26 | 0 | return(map $self->$_(), map "get_$_", $self->members()); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub set_all { | ||||||||
|
Subroutine
set_all: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 30 | 0 | my $self = shift; | |||||||||
| 31 | 0 | foreach my $member (map "set_$_", $self->members) { | |||||||||
| 32 | 0 | ▶ | last if not @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | my $value = shift @_; | |||||||||
| 34 | 0 | ▶ | next if not defined $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | $self->$member($value); | |||||||||
| 36 | } | ||||||||||
| 37 | 0 | return 1; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 3 | 1; | |||||||||
| 41 | __END__ | ||||||||||