« OpenGbg/Service/TrafficCamera/CameraDevices.pm
↑ Summary
OpenGbg/Service/StyrOchStall/GetBikeStations.pm »
| 1 | 6 | ▶ | use 5.10.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | package OpenGbg::Service::Bridge; | ||
| 6 | |||
| 7 | # ABSTRACT: Entry point to the Bridge service | ||
| 8 | 6 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |
| 9 | 6 | our $VERSION = '0.1404'; | |
| 10 | |||
| 11 | 6 | ▶ | use OpenGbg::Elk; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 6 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 6 | ▶ | use Types::Standard qw/Str/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 6 | ▶ | use OpenGbg::Service::Bridge::GetIsCurrentlyOpen; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 6 | ▶ | use OpenGbg::Service::Bridge::GetOpenedStatus; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | 6 | with 'OpenGbg::Service::Getter'; | |
| 19 | |||
| 20 | 6 | has handler => ( | |
| 21 | is => 'ro', | ||
| 22 | required => 1, | ||
| 23 | ); | ||
| 24 | 6 | has service_base => ( | |
| 25 | is => 'rw', | ||
| 26 | isa => Str, | ||
| 27 | default => 'BridgeService/v1.0/', | ||
| 28 | ); | ||
| 29 | |||
| 30 | 0 | ▶ | sub get_is_currently_open { |
|
Subroutine
get_is_currently_open: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 31 | 0 | my $self = shift; | |
| 32 | |||
| 33 | 0 | my $url = 'GetGABOpenedStatus/%s?'; | |
| 34 | 0 | my $response = $self->getter($url, 'get_is_currently_open'); | |
| 35 | |||
| 36 | 0 | return OpenGbg::Service::Bridge::GetIsCurrentlyOpen->new(xml => $response); | |
| 37 | } | ||
| 38 | 0 | ▶ | sub get_opened_status { |
|
Subroutine
get_opened_status: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 39 | 0 | my $self = shift; | |
| 40 | 0 | my $start = shift; | |
| 41 | 0 | my $end = shift; | |
| 42 | |||
| 43 | 0 | my $url = "GetGABOpenedStatus/%s/$start/$end?"; | |
| 44 | 0 | my $response = $self->getter($url, 'get_opened_status'); | |
| 45 | |||
| 46 | 0 | return OpenGbg::Service::Bridge::GetOpenedStatus->new(xml => $response); | |
| 47 | } | ||
| 48 | |||
| 49 | 0 | ▶ | sub is_open { |
|
Subroutine
is_open: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 50 | 0 | return shift->get_is_currently_open->is_open; | |
| 51 | } | ||
| 52 | |||
| 53 | 6 | __PACKAGE__->meta->make_immutable; | |
| 54 | |||
| 55 | 6 | 1; | |
| 56 | |||
| 57 | __END__ | ||