Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Travel-Status-DE-HAFAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
Travel-Status-DE-HAFAS
Commits
43e06258
Commit
43e06258
authored
10 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Result: Add ->type accessor
parent
68cd2f9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Travel/Status/DE/DeutscheBahn/Result.pm
+14
-0
14 additions, 0 deletions
lib/Travel/Status/DE/DeutscheBahn/Result.pm
with
14 additions
and
0 deletions
lib/Travel/Status/DE/DeutscheBahn/Result.pm
+
14
−
0
View file @
43e06258
...
...
@@ -137,6 +137,15 @@ sub TO_JSON {
return
{
%
{
$self
}
};
}
sub
type
{
my
(
$self
)
=
@_
;
# $self->{train} is either "TYPE 12345" or "TYPE12345"
my
(
$type
)
=
(
$self
->
{
train
}
=~
m{ ^ ([A-Z]+) }x
);
return
$type
;
}
1
;
__END__
...
...
@@ -259,6 +268,11 @@ references of the form C<< [ arrival time, station name ] >>.
Returns the arrival/departure time as string in "hh:mm" format.
=item $result->type
Returns the type of this train, e.g. "S" for S-Bahn, "RE" for Regional Express
or "ICE" for InterCity-Express.
=back
=head2 INTERNAL
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment