Class: OnConnect

Inherits:
Object
  • Object
show all
Includes:
DataDelivery
Defined in:
lib/onconnect.rb

Instance Method Summary collapse

Methods included from Celebrities

#celebrity_airings, #celebrity_details, #celebrity_images, #celebrity_on_talk_shows

Methods included from Lineups

#lineup_airings, #lineup_by_postal_code, #lineup_channel_listings, #lineup_details

Methods included from Movies

#movie_airings, #movie_airings_by_lineup, #movie_future_releases, #movie_showtimes, #movie_showtimes_local, #movie_versions, #screenplay_trailers, #theaters_by_postal_code, #theaters_details, #theaters_showtimes

Methods included from Programs

#program_airings, #program_details, #program_search

Methods included from Series

#series_airings, #series_details, #series_episodes

Methods included from Stations

#stations_airings, #stations_details

Constructor Details

#initialize(api_key) ⇒ OnConnect

Returns a new instance of OnConnect.



9
10
11
12
# File 'lib/onconnect.rb', line 9

def initialize(api_key)
  @api_key = api_key
  @url = 'http://data.tmsapi.com/v1.1/'
end

Instance Method Details

#get(search, dyn_params) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/onconnect.rb', line 14

def get(search, dyn_params)
  uri = URI(@url + search)
  uri.query = URI.encode_www_form(dyn_params)

  response = Net::HTTP.get_response(uri)
  response.body
end