Opendata/GTFS/Type/FareRule.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 32 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Opendata/GTFS/Type/FareAttribute.pm ↑ Summary Opendata/GTFS/Type/Frequency.pm »
1 4 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Opendata::GTFS::Type::FareRule;
6  
7 # ABSTRACT: Fare rule
8 4 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9 4 our $VERSION = '0.0202';
10  
11 4 ▶use Opendata::GTFS::Feed::Elk;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Types::Standard qw/Maybe Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 4 my @columns = qw/
15 1 fare_id
16 0 route_id
17 0 origin_id
18 0 destination_id
19 0 contains_id
20 /;
21  
22 4 ▶for (my $i = 0; $i < $#columns; $i += 2) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $#columns) 20 4 24
23 20 my $required = $columns[$i];
24 20 my $column = $columns[$i + 1];
25  
26 20 ▶ has $column => (
Branch: 1 branch
BranchTrueFalseTotal
$required ? : 4 16 20
27 is => 'ro',
28 isa => ($required ? Str : Maybe[Str]),
29 );
30 }
31  
32 4 __PACKAGE__->meta->make_immutable;
33  
34 4 1;
35  
36 __END__
« Opendata/GTFS/Type/FareAttribute.pm ↑ Summary Opendata/GTFS/Type/Frequency.pm »