Class: Rovi::Api

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rovi/api.rb

Direct Known Subclasses

Services::Recommendations, Services::Search

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret) ⇒ Api

Returns a new instance of Api.



11
12
13
14
15
# File 'lib/rovi/api.rb', line 11

def initialize(api_key, api_secret)
  @api_key, @api_secret = api_key, api_secret
  @version = "v1"
  @service_name = "data"
end

Instance Method Details

#get(category, method, params = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/rovi/api.rb', line 17

def get(category, method, params = {})
  params.merge!(required_params)
  options = self.class.default_options.dup.merge!({
    query: params
  })
  path = build_path(category, method)

  response = self.class.get(path, options)
  response.parsed_response
end