OpenGbg/Service/StyrOchStall/GetBikeStations.pm

filter: Statementstmt 86.4% 32 / 37 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 72.7% 8 / 11 Podpod 100% 1 / 1 totaltotal 83.6% 41 / 49 CC 1 SCAR 2.4
CC
1
Cov
86%
get_by_id
2.0
__ANON__
2.0
_build_timestamp
2.0
CRAP 1.3
« OpenGbg/Service/Bridge.pm ↑ Summary OpenGbg/Service/AirQuality.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::StyrOchStall::GetBikeStations;
6  
7 # ABSTRACT: Get data on all bike stations
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_list stations => '/x:RentalBikes/x:Stations/x:Details' => 'OpenGbg::Service::StyrOchStall::Station',
28 handles => {
29 all => 'elements',
30 count => 'count',
31 filter => 'grep',
32 find => 'first',
33 get_by_index => 'get',
34 map => 'map',
35 sort => 'sort',
36 };
37  
38 0 ▶sub get_by_id {
Subroutine get_by_id: not called CC=1 SCAR=6.9
Pod documented
39 0 my $self = shift;
40 0 my $id = shift;
41  
42 0 ▶ return $self->find(sub { $_->id == $id });
Subroutine __ANON__: not called CC=1 SCAR=6.9
43 }
44  
45 7 has timestamp => (
46 is => 'ro',
47 isa => DateTime,
48 lazy => 1,
49 builder => 1,
50 );
51  
52 0 ▶sub _build_timestamp {
Subroutine _build_timestamp: not called CC=1 SCAR=6.9
53 0 return DateTime::Format::HTTP->parse_datetime(shift->_timestamp);
54 }
55  
56 7 finalize_class();
57  
58 7 1;
59  
60 __END__
« OpenGbg/Service/Bridge.pm ↑ Summary OpenGbg/Service/AirQuality.pm »