Class: Gracenote::OnConnect::Theater

Inherits:
Object
  • Object
show all
Defined in:
lib/gracenote/on_connect.rb

Class Method Summary collapse

Class Method Details

.find_by_zip(zip) ⇒ Object



27
28
29
30
# File 'lib/gracenote/on_connect.rb', line 27

def self.find_by_zip(zip)
  params = { api_key: OnConnect.configuration.api_key, zip: zip }
  self.get("theatres", params)
end

.showtimes(theater_id, start_date: Date.today.to_s, days: 1, size: nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gracenote/on_connect.rb', line 32

def self.showtimes(theater_id, start_date: Date.today.to_s, days: 1, size: nil)
  params = {
    api_key: OnConnect.configuration.api_key,
    startDate: start_date,
    numDays: days,
    imageSize: size
  }

  params.select! { |k, v| k unless v.nil? }

  self.get("theatres/#{theater_id}/showings", params)
end