OpenGbg/Service/Bridge/GetOpenedStatus.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« OpenGbg/Service/Bridge/BridgeOpenings.pm ↑ Summary OpenGbg/Service/TrafficCamera/CameraDevice.pm »
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::Bridge::GetOpenedStatus;
6  
7 # ABSTRACT: A list of bridge openings
8 7 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9 7 our $VERSION = '0.1401';
10  
11 7 ▶use XML::Rabbit::Root;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 ▶use Types::Standard qw/Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 7 has xml => (
16 is => 'ro',
17 isa => Str,
18 required => 1,
19 );
20  
21 7 add_xpath_namespace 'x' => 'TK.DevServer.Services.BridgeService';
22  
23 7 has_xpath_object bridge_openings => '/x:BridgeOpenings' => 'OpenGbg::Service::Bridge::BridgeOpenings';
24  
25 7 finalize_class();
26  
27 7 1;
28  
29 __END__
30  
31 =pod
32  
33 =encoding utf-8
34  
35 =head1 NAME
36  
37 OpenGbg::Service::Bridge::GetOpenedStatus - A list of bridge openings
38  
39 =head1 VERSION
40  
41 Version 0.1401, released 2016-05-05.
42  
43 =head1 SYNOPSIS
44  
45 my $bridge = OpenGbg->new->bridge;
46 my $get_opened_status = $bridge->get_opened_status('2014-10-15', '2014-11-01');
47  
48 my $opening = $get_opened_status->bridge_openings->get_by_index(5);
49  
50 printf 'It was %s at %s on %s', $opening->was_open ? 'open' : 'closed', $opening->timestamp->hms, $opening->timestamp->ymd;
51  
52 =head1 METHODS
53  
54 =head2 bridge_openings
55  
56 The service returns a list of status changes. The list is prepended with the status at midnight of the start date (given to get_opened_status
57 in L<Bridge|OpenGbg::Service::Bridge>), and appended with the status at midnight to the end date.
58  
59 Returns the list of status changes in the response in a L<OpenGbg::Service::Bridge::BridgeOpenings> object.
60  
61 =head1 SOURCE
62  
63 L<https://github.com/Csson/p5-OpenGbg>
64  
65 =head1 HOMEPAGE
66  
67 L<https://metacpan.org/release/OpenGbg>
68  
69 =head1 AUTHOR
70  
71 Erik Carlsson <info@code301.com>
72  
73 =head1 COPYRIGHT AND LICENSE
74  
75 This software is copyright (c) 2016 by Erik Carlsson.
76  
77 This is free software; you can redistribute it and/or modify it under
78 the same terms as the Perl 5 programming language system itself.
79  
80 =cut
« OpenGbg/Service/Bridge/BridgeOpenings.pm ↑ Summary OpenGbg/Service/TrafficCamera/CameraDevice.pm »