| 1 | package Weather::YR::Model::WindDirection; | ||
| 2 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | extends 'Weather::YR::Model'; | |
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Weather::YR::Model::WindDirection | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | This class represents a data point's wind direction. | ||
| 14 | |||
| 15 | =head1 METHODS | ||
| 16 | |||
| 17 | This class inherits all the methods from L<Weather::YR::Model> and provides the | ||
| 18 | following new methods: | ||
| 19 | |||
| 20 | =head2 degrees | ||
| 21 | |||
| 22 | Returns the current data point's wind direction in degrees. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | 3 | has 'degrees' => ( | |
| 27 | isa => 'Num', | ||
| 28 | is => 'ro', | ||
| 29 | required => 1, | ||
| 30 | ); | ||
| 31 | |||
| 32 | =head2 name | ||
| 33 | |||
| 34 | Returns the current data point's wind direction as a name, ie. "N" for north, | ||
| 35 | "SW" for south-east etc. | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | 3 | has 'name' => ( | |
| 40 | isa => 'Str', | ||
| 41 | is => 'ro', | ||
| 42 | required => 1, | ||
| 43 | ); | ||
| 44 | |||
| 45 | # | ||
| 46 | # The End | ||
| 47 | # | ||
| 48 | 3 | __PACKAGE__->meta->make_immutable; | |
| 49 | |||
| 50 | 3 | 1; | |