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
db263b06
Unverified
Commit
db263b06
authored
2 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
new_p: support journey argument
parent
717b0172
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Travel/Status/DE/HAFAS.pm
+15
-5
15 additions, 5 deletions
lib/Travel/Status/DE/HAFAS.pm
with
15 additions
and
5 deletions
lib/Travel/Status/DE/HAFAS.pm
+
15
−
5
View file @
db263b06
...
...
@@ -188,7 +188,7 @@ sub new {
}
if
(
not
$conf
{
station
}
and
not
$conf
{
journey
}
)
{
confess
('
Y
ou
ne
ed to specify a station
');
confess
('
station or j
ou
r
ne
y must be specified
');
}
if
(
not
defined
$service
)
{
...
...
@@ -363,8 +363,8 @@ sub new_p {
my
(
$obj
,
%conf
)
=
@_
;
my
$promise
=
$conf
{
promise
}
->
new
;
if
(
not
$conf
{
station
}
)
{
return
$promise
->
reject
('
station flag must be passed
');
if
(
not
$conf
{
station
}
and
not
$conf
{
journey
}
)
{
return
$promise
->
reject
('
station
or journey
flag must be passed
');
}
my
$self
=
$obj
->
new
(
%conf
,
async
=>
1
);
...
...
@@ -375,8 +375,18 @@ sub new_p {
my
(
$content
)
=
@_
;
$self
->
{
raw_json
}
=
$self
->
{
json
}
->
decode
(
$content
);
$self
->
check_mgate
;
$self
->
parse_board
;
$promise
->
resolve
(
$self
);
if
(
$conf
{
journey
}
)
{
$self
->
parse_journey
;
}
else
{
$self
->
parse_board
;
}
if
(
$self
->
errstr
)
{
$promise
->
reject
(
$self
->
errstr
);
}
else
{
$promise
->
resolve
(
$self
);
}
return
;
}
)
->
catch
(
...
...
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