Class: TMSAPI::Resource::Stations

Inherits:
Base
  • Object
show all
Defined in:
lib/tmsapi/resource/stations.rb

Instance Method Summary collapse

Methods inherited from Base

#get

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, options = {})
  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