YR/LocationForecast/DataPoint.pm

filter: Statementstmt 80.0% 20 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 73.3% 22 / 30 CC 1 SCAR 4.1
CC
1
Cov
80%
__ANON__
2.0
add_precipitation
2.0
BEGIN
1.0
CRAP 1.5
« YR/Model/Temperature.pm ↑ Summary YR/Lang/Symbol.pm »
1 package Weather::YR::LocationForecast::DataPoint;
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::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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
154 3 );
155  
156 sub add_precipitation {
157 0 ▶ my $self = shift;
Subroutine add_precipitation: not called CC=1 SCAR=6.9
Pod undocumented
158 0 my $p = shift;
159  
160 0 push( @{$self->precipitations}, $p );
161 }
162  
163 #
164 # The End
165 #
166 3 __PACKAGE__->meta->make_immutable;
167  
168 3 1;
« YR/Model/Temperature.pm ↑ Summary YR/Lang/Symbol.pm »