| 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::FareAttribute; | ||||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: Fare attribute | ||||||||||
| 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 | 1 price | ||||||||||
| 17 | 1 currency_type | ||||||||||
| 18 | 1 payment_method | ||||||||||
| 19 | 1 transfers | ||||||||||
| 20 | 0 transfer_duration | ||||||||||
| 21 | /; | ||||||||||
| 22 | |||||||||||
| 23 | 4 | ▶ | for (my $i = 0; $i < $#columns; $i += 2) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 24 | my $required = $columns[$i]; | |||||||||
| 25 | 24 | my $column = $columns[$i + 1]; | |||||||||
| 26 | |||||||||||
| 27 | 24 | ▶ | has $column => ( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | is => 'ro', | ||||||||||
| 29 | isa => ($required ? Str : Maybe[Str]), | ||||||||||
| 30 | ); | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 34 | |||||||||||
| 35 | 4 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||