go_transit 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee9e60a59caf970a1ede5d1f412722b2710f00265f9e3f24d6da081261f0b044
4
- data.tar.gz: 8992c200e8f9a727c4d37cc96843d972f5c16c3df7c21782511fbee01f644869
3
+ metadata.gz: 7b30c2d11058a8d509c7950071d7392ecbdf56463063613da290604125ca67f0
4
+ data.tar.gz: 2906067cbfd752a3e5c7182459015f5a6843ecec6badd49a2ec0746a3ebbce35
5
5
  SHA512:
6
- metadata.gz: 2e9bf26e3c22f7e28c3392e94e914c8c654b01b2ed9d8d42810b042ebff2daa01c115aa01ef23826b03b57eef4e7925b5cf73b12e79c8a2a3ad9b8a5711b94ae
7
- data.tar.gz: d961631c8e1749670904195b61e4e7b5b44e1ed80e306873a34ecbb5b475c6eb51fc6165360524cf4fb151754caef2e0c2c642a2d66dbe56f8b0a803dcfd654f
6
+ metadata.gz: ac888ca4fe0a81be3390d69b117a790cb3129d523e46a9c496dd5a8a04736ebfe295f9b10dc65ae532c344bcc96516d7c90abefb810872ee0e6c6282aadfaef3
7
+ data.tar.gz: aa24ae455d0fa37299ebe2bc7209d4eaa8495e92bb79a454a8a96f57e2227452f2051548a9859d3438d83f1c0c5cc599ff683b7164fcf5a4b1aa24111740e75c
@@ -42,7 +42,11 @@ module GoTransit
42
42
  end
43
43
 
44
44
  def to_utc(date)
45
- date.in_time_zone("America/Toronto").utc
45
+ to_local(date).utc
46
+ end
47
+
48
+ def to_local(date, timezone: "America/Toronto")
49
+ date.in_time_zone(timezone)
46
50
  end
47
51
  end
48
52
  end
@@ -13,5 +13,9 @@ module GoTransit
13
13
  def time_stamp_utc
14
14
  to_utc(time_stamp)
15
15
  end
16
+
17
+ def time_stamp_local
18
+ to_local(time_stamp)
19
+ end
16
20
  end
17
21
  end
@@ -2,4 +2,4 @@ module GoTransit
2
2
  class Schedule::Journey::SchJourney::Service::Transfer < ApiResource
3
3
  attr_accessor :code, :order, :time
4
4
  end
5
- end
5
+ end
@@ -13,5 +13,13 @@ module GoTransit
13
13
  def end_time_utc
14
14
  to_utc(end_time)
15
15
  end
16
+
17
+ def start_time_local
18
+ to_local(start_time)
19
+ end
20
+
21
+ def end_time_local
22
+ to_local(end_time)
23
+ end
16
24
  end
17
25
  end
@@ -2,4 +2,4 @@ module GoTransit
2
2
  class Schedule::Journey::SchJourney < ApiResource
3
3
  attr_accessor :date, :time, :to, :from, :services
4
4
  end
5
- end
5
+ end
@@ -5,5 +5,13 @@ module GoTransit
5
5
  def major?
6
6
  is_major.to_i.positive?
7
7
  end
8
+
9
+ def time_utc
10
+ to_utc(time)
11
+ end
12
+
13
+ def time_local
14
+ to_local(time)
15
+ end
8
16
  end
9
17
  end
@@ -1,13 +1,5 @@
1
1
  module GoTransit
2
2
  class Schedule::Trip::Stop::ArrivalTime < ApiResource
3
3
  attr_accessor :scheduled, :computed, :status
4
-
5
- def scheduled_utc
6
- to_utc(scheduled)
7
- end
8
-
9
- def computed_utc
10
- to_utc(computed)
11
- end
12
4
  end
13
5
  end
@@ -1,13 +1,5 @@
1
1
  module GoTransit
2
2
  class Schedule::Trip::Stop::DepartureTime < ApiResource
3
3
  attr_accessor :scheduled, :computed, :status
4
-
5
- def scheduled_utc
6
- to_utc(scheduled)
7
- end
8
-
9
- def computed_utc
10
- to_utc(computed)
11
- end
12
4
  end
13
5
  end
@@ -6,5 +6,9 @@ module GoTransit
6
6
  def time_stamp_utc
7
7
  to_utc(time_stamp)
8
8
  end
9
+
10
+ def time_stamp_local
11
+ to_local(time_stamp)
12
+ end
9
13
  end
10
14
  end
@@ -14,5 +14,9 @@ module GoTransit
14
14
  def modified_date_utc
15
15
  to_utc(modified_date)
16
16
  end
17
+
18
+ def modified_date_local
19
+ to_local(modified_date)
20
+ end
17
21
  end
18
22
  end
@@ -7,5 +7,9 @@ module GoTransit
7
7
  def posted_date_time_utc
8
8
  to_utc(posted_date_time)
9
9
  end
10
+
11
+ def posted_date_time_local
12
+ to_local(posted_date_time)
13
+ end
10
14
  end
11
15
  end
@@ -11,5 +11,9 @@ module GoTransit
11
11
  def time_utc
12
12
  to_utc(time)
13
13
  end
14
+
15
+ def time_local
16
+ to_local(time)
17
+ end
14
18
  end
15
19
  end
@@ -18,5 +18,17 @@ module GoTransit
18
18
  def update_time_utc
19
19
  to_utc(update_time)
20
20
  end
21
+
22
+ def scheduled_departure_time_local
23
+ to_local(scheduled_departure_time)
24
+ end
25
+
26
+ def computed_departure_time_local
27
+ to_local(computed_departure_time)
28
+ end
29
+
30
+ def update_time_local
31
+ to_local(update_time)
32
+ end
21
33
  end
22
34
  end
@@ -1,3 +1,3 @@
1
1
  module GoTransit
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_transit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Mazur