| 1 | 7 | ▶ | use 5.10.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package OpenGbg::Service::AirQuality::GetLatestMeasurement; | ||||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: Get the latest air quality measurement | ||||||||||
| 8 | 7 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |||||||||
| 9 | 7 | our $VERSION = '0.1404'; | |||||||||
| 10 | |||||||||||
| 11 | 7 | ▶ | use XML::Rabbit::Root; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 7 | ▶ | use Types::Standard qw/Bool Str/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 7 | has xml => ( | |||||||||
| 15 | is => 'ro', | ||||||||||
| 16 | isa => Str, | ||||||||||
| 17 | required => 1, | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | 7 | add_xpath_namespace 'x' => 'TK.DevServer.Services.AirQualityService'; | |||||||||
| 21 | |||||||||||
| 22 | 7 | has measurement_called => ( | |||||||||
| 23 | is => 'rw', | ||||||||||
| 24 | isa => Bool, | ||||||||||
| 25 | default => 0, | ||||||||||
| 26 | ); | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub measurement { | ||||||||
|
Subroutine
measurement: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 29 | 0 | my $self = shift; | |||||||||
| 30 | 0 | ▶ | warn q{Deprecated attribute 'measurement' called} if !$self->measurement_called; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | $self->measurement_called(1); | |||||||||
| 32 | 0 | return $self->_measurement; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 7 | has_xpath_object _measurement => '/x:Measurement' => 'OpenGbg::Service::AirQuality::Measurement', | |||||||||
| 36 | handles => [qw/ | ||||||||||
| 37 | starttime | ||||||||||
| 38 | endtime | ||||||||||
| 39 | |||||||||||
| 40 | temperature | ||||||||||
| 41 | temperature_unit | ||||||||||
| 42 | humidity | ||||||||||
| 43 | humidity_unit | ||||||||||
| 44 | solar_insolation | ||||||||||
| 45 | solar_insolation_unit | ||||||||||
| 46 | air_pressure | ||||||||||
| 47 | air_pressure_unit | ||||||||||
| 48 | wind_speed | ||||||||||
| 49 | wind_speed_unit | ||||||||||
| 50 | wind_direction | ||||||||||
| 51 | wind_direction_unit | ||||||||||
| 52 | rainfall | ||||||||||
| 53 | rainfall_unit | ||||||||||
| 54 | |||||||||||
| 55 | total_index | ||||||||||
| 56 | |||||||||||
| 57 | no2 | ||||||||||
| 58 | no2_unit | ||||||||||
| 59 | no2_index | ||||||||||
| 60 | |||||||||||
| 61 | so2 | ||||||||||
| 62 | so2_unit | ||||||||||
| 63 | so2_index | ||||||||||
| 64 | |||||||||||
| 65 | o3 | ||||||||||
| 66 | o3_unit | ||||||||||
| 67 | o3_index | ||||||||||
| 68 | |||||||||||
| 69 | pm10 | ||||||||||
| 70 | pm10_unit | ||||||||||
| 71 | pm10_index | ||||||||||
| 72 | |||||||||||
| 73 | co | ||||||||||
| 74 | co_unit | ||||||||||
| 75 | co_index | ||||||||||
| 76 | |||||||||||
| 77 | nox | ||||||||||
| 78 | nox_unit | ||||||||||
| 79 | nox_index | ||||||||||
| 80 | |||||||||||
| 81 | pm2_5 | ||||||||||
| 82 | pm2_5_unit | ||||||||||
| 83 | pm2_5_index | ||||||||||
| 84 | |||||||||||
| 85 | total_levels | ||||||||||
| 86 | no2_levels | ||||||||||
| 87 | so2_levels | ||||||||||
| 88 | o3_levels | ||||||||||
| 89 | co_levels | ||||||||||
| 90 | pm10_levels | ||||||||||
| 91 | nox_levels | ||||||||||
| 92 | pm2_5_levels | ||||||||||
| 93 | |||||||||||
| 94 | to_text | ||||||||||
| 95 | weather_to_text | ||||||||||
| 96 | air_quality_to_text | ||||||||||
| 97 | /]; | ||||||||||
| 98 | |||||||||||
| 99 | 7 | finalize_class(); | |||||||||
| 100 | |||||||||||
| 101 | 7 | 1; | |||||||||
| 102 | |||||||||||
| 103 | __END__ | ||||||||||