NAME
OpenGbg::Service::TrafficCamera::CameraDevices - A list of traffic cameras
VERSION
Version 0.1404, released 2018-05-19.
SYNOPSIS
my $traffic_camera_service = OpenGbg->new->traffic_camera;
my $get_traffic_cameras = $traffic_camera_service->get_traffic_cameras;
my $camera_devices = $get_traffic_cameras->camera_devices;
print $camera_devices->get_by_index(0)->to_text;
METHODS
all
Returns an array of all OpenGbg::Service::TrafficCamera::CameraDevice objects in the response.
count
Returns the number of CameraDevice objects in the response.
filter(sub { ... })
Allows filtering of the traffic cameras. Takes a sub routine reference, into which all CameraDevice objects are passed one-by-one into $_
. Works like grep
.
find(sub { ... })
Just like filter
, except it returns the first traffic camera that matches.
get_by_index($index)
Returns the n:th OpenGbg::Service::TrafficCamera::CameraDevice object in the response.
get_by_id($id)
Returns the traffic camera with id $id
.
map(sub { ... })
Like filter
it takes a sub routine reference and passes each CameraDevice as $_
. Eg, to get a total count of free bikes:
sort(sub { ... })
Like filter
it takes a sub routine reference. It works just like sort
except the two CameraDevice objects to compare are passed as $_[0]
and $_[1]
SOURCE
https://github.com/Csson/p5-OpenGbg
HOMEPAGE
https://metacpan.org/release/OpenGbg
AUTHOR
Erik Carlsson <info@code301.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.