Module: StationMaster::Schedule::Find
Instance Method Summary collapse
- #find_station_arrivals(station_code, time = Time.now) ⇒ Object
- #find_station_departures(station_code, time = Time.now) ⇒ Object
Instance Method Details
#find_station_arrivals(station_code, time = Time.now) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/station_master/schedule/find.rb', line 6 def find_station_arrivals(station_code, time = Time.now) MultiJson::load( remote_call(:arrivals, { station_code: station_code, time: format_time(time.in_time_zone(TIME_ZONE)) }), symbolize_keys: true) .inject([]) do |array, arrival_hash| array << Arrival.new(arrival_hash) end end |
#find_station_departures(station_code, time = Time.now) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/station_master/schedule/find.rb', line 17 def find_station_departures(station_code, time = Time.now) MultiJson::load( remote_call(:departures, { station_code: station_code, time: format_time(time.in_time_zone(TIME_ZONE)) }), symbolize_keys: true) .inject([]) do |array, arrival_hash| array << Departure.new(arrival_hash) end end |