File Coverage

blib/lib/Weather/YR/LocationForecast/DataPoint.pm
Criterion Covered Total %
statement 6 10 60.0
branch n/a
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 14 57.1


line stmt bran cond sub pod time code
1             package Weather::YR::LocationForecast::DataPoint;
2 3     3   13 use Moose;
  3         4  
  3         24  
3 3     3   15549 use namespace::autoclean;
  3         6  
  3         27  
4              
5             extends 'Weather::YR::DataPoint';
6              
7             =head1 NAME
8              
9             Weather::YR::LocationForecast::DataPoint - Class that represents a location
10             forecast's data point.
11              
12             =head1 DESCRIPTION
13              
14             Don't use this class directly; it's used as a "background helper class" for
15             L<Weather::YR::LocationForecast>.
16              
17             =head1 METHODS
18              
19             This class inherits all the methods from L<Weather::YR::DataPoint> and provides
20             the following new methods:
21              
22             =head2 temperature
23              
24             Returns this data point's L<Weather::YR::Model::Temperature> object.
25              
26             =cut
27              
28             has 'temperature' => (
29             isa => 'Weather::YR::Model::Temperature',
30             is => 'ro',
31             required => 1,
32             );
33              
34             =head2 wind_direction
35              
36             Returns this data point's L<Weather::YR::Model::WindDirection> object.
37              
38             =cut
39              
40             has 'wind_direction' => (
41             isa => 'Weather::YR::Model::WindDirection',
42             is => 'ro',
43             required => 1,
44             );
45              
46             =head2 wind_speed
47              
48             Returns this data point's L<Weather::YR::Model::::WindSpeed> object.
49              
50             =cut
51              
52             has 'wind_speed' => (
53             isa => 'Weather::YR::Model::WindSpeed',
54             is => 'ro',
55             required => 1,
56             );
57              
58             =head2 humidity
59              
60             Returns this data point's L<Weather::YR::Model::Humidity> object.
61              
62             =cut
63              
64             has 'humidity' => (
65             isa => 'Weather::YR::Model::Humidity',
66             is => 'ro',
67             required => 1,
68             );
69              
70             =head2 pressure
71              
72             Returns this data point's L<Weather::YR::Model::Pressure> object.
73              
74             =cut
75              
76             has 'pressure' => (
77             isa => 'Weather::YR::Model::Pressure',
78             is => 'ro',
79             required => 1,
80             );
81              
82             =head2 cloudiness
83              
84             Returns this data point's L<Weather::YR::Model::Cloudiness> object.
85              
86             =cut
87              
88             has 'cloudiness' => (
89             isa => 'Weather::YR::Model::Cloudiness',
90             is => 'ro',
91             required => 1,
92             );
93              
94             =head2 fog
95              
96             Returns this data point's L<Weather::YR::Model::Fog> object.
97              
98             =cut
99              
100             has 'fog' => (
101             isa => 'Weather::YR::Model::Fog',
102             is => 'ro',
103             required => 1,
104             );
105              
106             =head2 dew_point_temperature
107              
108             Returns this data point's L<Weather::YR::Model::DewPointTemperature> object.
109              
110             =cut
111              
112             has 'dew_point_temperature' => (
113             isa => 'Weather::YR::Model::DewPointTemperature',
114             is => 'ro',
115             required => 1,
116             );
117              
118             =head2 temperature_probability
119              
120             Returns this data point's L<Weather::YR::Model::Probability::Temperature> object.
121              
122             =cut
123              
124             has 'temperature_probability' => (
125             isa => 'Weather::YR::Model::Probability::Temperature',
126             is => 'ro',
127             required => 1,
128             );
129              
130             =head2 wind_probability
131              
132             Returns this data points L<Weather::YR::Model::Probability::Wind> object.
133              
134             =cut
135              
136             has 'wind_probability' => (
137             isa => 'Weather::YR::Model::Probability::Wind',
138             is => 'ro',
139             required => 1,
140             );
141              
142             =head2 precipitations
143              
144             Returns an array reference of L<Weather::YR::Model::Precipitation> objects for
145             this data point.
146              
147             =cut
148              
149             has 'precipitations' => (
150             isa => 'ArrayRef[Weather::YR::Model::Precipitation]',
151             is => 'rw',
152             required => 0,
153             default => sub { [] },
154             );
155              
156             sub add_precipitation {
157 0     0 0   my $self = shift;
158 0           my $p = shift;
159              
160 0           push( @{$self->precipitations}, $p );
  0            
161             }
162              
163             #
164             # The End
165             #
166             __PACKAGE__->meta->make_immutable;
167              
168             1;