| 1 | 1 | ▶ | use 5.10.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | package OpenGbg::Service::TrafficCamera::CameraDevice; | ||
| 6 | |||
| 7 | # ABSTRACT: Data about a traffic camera | ||
| 8 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | ||
| 9 | our $VERSION = '0.1404'; | ||
| 10 | |||
| 11 | 1 | ▶ | use XML::Rabbit; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use syntax 'qs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 1 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | has_xpath_value id => './x:ID'; | ||
| 16 | |||
| 17 | has_xpath_value storage_duration_minutes => './x:StorageDurationMinutes'; | ||
| 18 | |||
| 19 | has_xpath_value capture_interval_seconds => './x:CaptureIntervalSeconds'; | ||
| 20 | |||
| 21 | has_xpath_value description => './x:Description'; | ||
| 22 | |||
| 23 | has_xpath_value model => './x:Model'; | ||
| 24 | |||
| 25 | has_xpath_value lat => './x:Lat'; | ||
| 26 | |||
| 27 | has_xpath_value long => './x:Long'; | ||
| 28 | |||
| 29 | 0 | ▶ | sub get_latest_image { |
|
Subroutine
get_latest_image: not called CC=1 SCAR=6.9
| |||
| 30 | 0 | my $self = shift; | |
| 31 | |||
| 32 | 0 | return OpenGbg->new->traffic_camera->get_camera_image($self->id); | |
| 33 | } | ||
| 34 | |||
| 35 | sub to_text { | ||
| 36 | my $self = shift; | ||
| 37 | |||
| 38 | return sprintf qs{ | ||
| 39 | Id: %s | ||
| 40 | Description: %s | ||
| 41 | Storage duration (m): %s | ||
| 42 | Capture interval (s): %s | ||
| 43 | Model: %s | ||
| 44 | Lat: %s | ||
| 45 | Long: %s | ||
| 46 | }, | ||
| 47 | $self->id, | ||
| 48 | $self->description, | ||
| 49 | $self->storage_duration_minutes, | ||
| 50 | $self->capture_interval_seconds, | ||
| 51 | $self->model, | ||
| 52 | $self->lat, | ||
| 53 | $self->long; | ||
| 54 | |||
| 55 | } | ||
| 56 | |||
| 57 | finalize_class(); | ||
| 58 | |||
| 59 | 1; | ||
| 60 | |||
| 61 | __END__ | ||