go_transit 0.7.2 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/go_transit/api_resource.rb +4 -0
- data/lib/go_transit/errors.rb +4 -4
- data/lib/go_transit/resources/metadata.rb +8 -0
- data/lib/go_transit/resources/schedule/journey/sch_journey/service/trip/stop.rb +1 -1
- data/lib/go_transit/resources/schedule/journey/sch_journey/service.rb +10 -2
- data/lib/go_transit/resources/schedule/trip/stop/arrival_time.rb +9 -1
- data/lib/go_transit/resources/schedule/trip/stop/departure_time.rb +9 -1
- data/lib/go_transit/resources/schedule/trip/stop.rb +2 -2
- data/lib/go_transit/resources/schedule/trip.rb +5 -1
- data/lib/go_transit/resources/service_at_a_glance/trip.rb +4 -0
- data/lib/go_transit/resources/service_update/exceptions/trip/stop.rb +1 -1
- data/lib/go_transit/resources/service_update/message.rb +4 -0
- data/lib/go_transit/resources/service_update/union_departures/trip.rb +4 -0
- data/lib/go_transit/resources/stop/next_service/line.rb +16 -4
- data/lib/go_transit/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac02d098fdf5e075c7be0c91f350223859f93642bf716da5705eff59b30fb053
|
4
|
+
data.tar.gz: 1c3d0ae74df441298dc26fd4d82075183166d6a2096ca304b1e69f80c71e2304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef5935c2c0a985620d94b2866bb667af52775814ecf7ea6df77c868c92f2be62a21caa16b2b02d9690ecf506458b6fb1f79054e9768958b664b02dfc0503c1b
|
7
|
+
data.tar.gz: 60e1819e3b878c7b800216284ca9b14b7f8768c35150c63af976d36624119df71cbbe26320c0108df3945bc1e8bd17efc626e5f5e0bc5a3fcd183c9e02961144
|
data/lib/go_transit/errors.rb
CHANGED
@@ -6,8 +6,8 @@ module GoTransit
|
|
6
6
|
end
|
7
7
|
|
8
8
|
NoContentError = Class.new(ApiError)
|
9
|
-
BadRequestError = Class.new(
|
10
|
-
UnauthorizedError = Class.new(
|
11
|
-
ForbiddenError = Class.new(
|
12
|
-
NotFoundError = Class.new(
|
9
|
+
BadRequestError = Class.new(ApiError)
|
10
|
+
UnauthorizedError = Class.new(ApiError)
|
11
|
+
ForbiddenError = Class.new(ApiError)
|
12
|
+
NotFoundError = Class.new(ApiError)
|
13
13
|
end
|
@@ -2,8 +2,16 @@ module GoTransit
|
|
2
2
|
class Metadata < ApiResource
|
3
3
|
attr_accessor :time_stamp, :error_code, :error_message
|
4
4
|
|
5
|
+
def to_s
|
6
|
+
"#{error_code} - #{error_message}"
|
7
|
+
end
|
8
|
+
|
5
9
|
def code
|
6
10
|
error_code.to_i
|
7
11
|
end
|
12
|
+
|
13
|
+
def time_stamp_utc
|
14
|
+
to_utc(time_stamp)
|
15
|
+
end
|
8
16
|
end
|
9
17
|
end
|
@@ -1,9 +1,17 @@
|
|
1
1
|
module GoTransit
|
2
2
|
class Schedule::Journey::SchJourney::Service < ApiResource
|
3
|
-
attr_accessor :colour, :type, :direction, :code, :start_time, :end_time,
|
3
|
+
attr_accessor :colour, :type, :direction, :code, :start_time, :end_time,
|
4
4
|
:duration, :accessible, :trips, :transfers, :links,
|
5
5
|
:start_sort_time, :end_sort_time, :trip_hash, :transfer_count
|
6
6
|
|
7
7
|
alias :transfer_links :links
|
8
|
+
|
9
|
+
def start_time_utc
|
10
|
+
to_utc(start_time)
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_time_utc
|
14
|
+
to_utc(end_time)
|
15
|
+
end
|
8
16
|
end
|
9
|
-
end
|
17
|
+
end
|
@@ -3,5 +3,9 @@ module GoTransit
|
|
3
3
|
attr_accessor :code, :parent_code, :status, :posted_date_time,
|
4
4
|
:subject_english, :subject_french, :body_english,
|
5
5
|
:body_french, :category, :sub_category, :lines, :stops, :trips
|
6
|
+
|
7
|
+
def posted_date_time_utc
|
8
|
+
to_utc(posted_date_time)
|
9
|
+
end
|
6
10
|
end
|
7
11
|
end
|
@@ -1,10 +1,22 @@
|
|
1
1
|
module GoTransit
|
2
2
|
class Stop::NextService::Line < ApiResource
|
3
|
-
attr_accessor :stop_code, :line_code, :line_name, :service_type,
|
4
|
-
:direction_code, :direction_name,
|
3
|
+
attr_accessor :stop_code, :line_code, :line_name, :service_type,
|
4
|
+
:direction_code, :direction_name,
|
5
5
|
:scheduled_departure_time, :computed_departure_time,
|
6
6
|
:departure_status, :scheduled_platform, :actual_platform,
|
7
|
-
:trip_order, :trip_number, :update_time, :status,
|
7
|
+
:trip_order, :trip_number, :update_time, :status,
|
8
8
|
:latitude, :longitude
|
9
|
+
|
10
|
+
def scheduled_departure_time_utc
|
11
|
+
to_utc(scheduled_departure_time)
|
12
|
+
end
|
13
|
+
|
14
|
+
def computed_departure_time_utc
|
15
|
+
to_utc(computed_departure_time)
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_time_utc
|
19
|
+
to_utc(update_time)
|
20
|
+
end
|
9
21
|
end
|
10
|
-
end
|
22
|
+
end
|
data/lib/go_transit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_transit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Mazur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.17'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: timecop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
description:
|
126
140
|
email:
|
127
141
|
executables: []
|
@@ -184,7 +198,7 @@ files:
|
|
184
198
|
- lib/go_transit/resources/stop/station.rb
|
185
199
|
- lib/go_transit/response.rb
|
186
200
|
- lib/go_transit/version.rb
|
187
|
-
homepage: https://github.com/jmazur/
|
201
|
+
homepage: https://github.com/jmazur/go_transit_ruby
|
188
202
|
licenses:
|
189
203
|
- MIT
|
190
204
|
metadata: {}
|