| 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::StyrOchStall::GetBikeStation; | ||
| 6 | |||
| 7 | # ABSTRACT: Get data about a bike station | ||
| 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 DateTime::Format::HTTP; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 7 | ▶ | use MooseX::AttributeShortcuts; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 7 | ▶ | use Types::Standard qw/Str/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 7 | ▶ | use Types::DateTime qw/DateTime/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 7 | has xml => ( | |
| 18 | is => 'ro', | ||
| 19 | isa => Str, | ||
| 20 | required => 1, | ||
| 21 | ); | ||
| 22 | |||
| 23 | 7 | add_xpath_namespace 'x' => 'TK.DevServer.Services.RentalBikeService'; | |
| 24 | |||
| 25 | 7 | has_xpath_value _timestamp => '/x:RentalBikes/x:TimeStamp'; | |
| 26 | |||
| 27 | 7 | has_xpath_object station => '/x:RentalBikes/x:Stations[1]/x:Details' => 'OpenGbg::Service::StyrOchStall::Station', | |
| 28 | handles => [qw/label capacity free_bikes free_stands full empty to_text/]; | ||
| 29 | |||
| 30 | 7 | has timestamp => ( | |
| 31 | is => 'ro', | ||
| 32 | isa => DateTime, | ||
| 33 | lazy => 1, | ||
| 34 | builder => 1, | ||
| 35 | ); | ||
| 36 | |||
| 37 | 0 | ▶ | sub _build_timestamp { |
|
Subroutine
_build_timestamp: not called CC=1 SCAR=6.9
| |||
| 38 | 0 | return DateTime::Format::HTTP->parse_datetime(shift->_timestamp); | |
| 39 | } | ||
| 40 | |||
| 41 | 7 | finalize_class(); | |
| 42 | |||
| 43 | 7 | 1; | |
| 44 | |||
| 45 | __END__ | ||