Class: TMSAPI::Resource::Stations
- Defined in:
- lib/tmsapi/resource/stations.rb
Instance Method Summary collapse
- #airings(stationId, params = nil) ⇒ Object
- #details(stationId, lineupId = nil) ⇒ Object
-
#initialize(connection, options = {}) ⇒ Stations
constructor
A new instance of Stations.
Methods inherited from Base
Constructor Details
#initialize(connection, options = {}) ⇒ Stations
Returns a new instance of Stations.
7 8 9 |
# File 'lib/tmsapi/resource/stations.rb', line 7 def initialize(connection, = {}) super(connection, "v1") end |
Instance Method Details
#airings(stationId, params = nil) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/tmsapi/resource/stations.rb', line 23 def airings(stationId, params = nil) params = { :startDateTime => Time.now.strftime("%Y-%m-%dT%H:%MZ")} unless params get(airings_path(stationId),params).each do |airing| TMSAPI::Model::Airing.new airing end end |
#details(stationId, lineupId = nil) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tmsapi/resource/stations.rb', line 11 def details(stationId, lineupId = nil) if lineupId then params = {:lineupId => lineupId} else params = nil end get(details_path(stationId),params).each do |station| TMSAPI::Model::Station.new station end end |