Class: Postmaster::TransitTimes

Inherits:
APIResource show all
Defined in:
lib/postmaster/transit_times.rb

Class Method Summary collapse

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from PostmasterObject

#[], #[]=, construct_from, #delete, #each, #has_key?, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Postmaster::PostmasterObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Postmaster::PostmasterObject

Class Method Details

.get(params = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/postmaster/transit_times.rb', line 5

def self.get(params={})
  response = Postmaster.request(:post, '/v1/times', params)
  if response[:services].nil?
    return nil
  end
  response[:services].map { |i| Postmaster::TransitTime.construct_from(i) }
end