station_master 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 4de874591cdfd745a466fc408c1218ea0e1100f8
4
- data.tar.gz: fb507d861874f3d5648bfbd87290791e539ac27e
3
+ metadata.gz: 3940cfff3af385f10f8677b083a42940700d8aaa
4
+ data.tar.gz: 65ccabc48ebca170de535bad2dded470e2d16ccd
5
5
  SHA512:
6
- metadata.gz: f7f717a8744bab7dc3ad8fea394073b56d7008d69136f73d6b5a89232701766e079f2163a3e063b7d79310b59002a3d91caa425bc76ada0d075fc486b5697d54
7
- data.tar.gz: 92757b8400c36a07ed535c0233441a922cdea718352a550863a677da784dbd60d2c364a5f399b77ef7c210c1d417f8ccb787cd5ad20d35c95ba9e48a8307a3b3
6
+ metadata.gz: 194a0fa98f3da2e7460d3134c3be3f1350a314b05d16fee46ad007f9ea179efe742668f2a34efbeca6ea5f9c3de4209b0b709cf25d93f1efea6763197e51a640
7
+ data.tar.gz: 577e3ae0c99d603ee9bf33c828e8063c61197f3a866a8378d1269da078752454c0a8837a56d710f2cedf05851aca7e67fe00fe635d82cdbd4f0b4b78b9380626
@@ -8,7 +8,7 @@ module StationMaster
8
8
  @train_type = hash[:categoria]
9
9
  @origin = hash[:origine]
10
10
  @platform = (hash[:binarioProgrammatoArrivoDescrizione].to_s || '0').strip
11
- @time = Time.at((hash[:orarioArrivo] || 0) / 1000)
11
+ @time = Time.at((hash[:orarioArrivo] || 0) / 1000).in_time_zone(TIME_ZONE)
12
12
  @delay = hash[:ritardo]
13
13
  end
14
14
 
@@ -8,7 +8,7 @@ module StationMaster
8
8
  @train_type = hash[:categoria]
9
9
  @destination = hash[:destinazione]
10
10
  @platform = (hash[:binarioProgrammatoPartenzaDescrizione].to_s || '0').strip
11
- @time = Time.at((hash[:orarioPartenza] || 0) / 1000)
11
+ @time = Time.at((hash[:orarioPartenza] || 0) / 1000).in_time_zone(TIME_ZONE)
12
12
  @delay = hash[:ritardo]
13
13
  end
14
14
 
@@ -3,22 +3,22 @@ module StationMaster
3
3
  module Find
4
4
  include Ask
5
5
 
6
- def find_station_arrivals(station_code, time = nil)
6
+ def find_station_arrivals(station_code, time = Time.now)
7
7
  MultiJson::load(
8
8
  remote_call(:arrivals, {
9
9
  station_code: station_code,
10
- time: format_time(time || Time.now.in_time_zone(TIME_ZONE)) }),
10
+ time: format_time(time.in_time_zone(TIME_ZONE)) }),
11
11
  symbolize_keys: true)
12
12
  .inject([]) do |array, arrival_hash|
13
13
  array << Arrival.new(arrival_hash)
14
14
  end
15
15
  end
16
16
 
17
- def find_station_departures(station_code, time = nil)
17
+ def find_station_departures(station_code, time = Time.now)
18
18
  MultiJson::load(
19
19
  remote_call(:departures, {
20
20
  station_code: station_code,
21
- time: format_time(time || Time.now.in_time_zone(TIME_ZONE)) }),
21
+ time: format_time(time.in_time_zone(TIME_ZONE)) }),
22
22
  symbolize_keys: true)
23
23
  .inject([]) do |array, arrival_hash|
24
24
  array << Departure.new(arrival_hash)
@@ -1,3 +1,3 @@
1
1
  module StationMaster
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: station_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Ordine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake