Method: Camdram::Client#get_show

Defined in:
lib/camdram/client.rb

#get_show(id) ⇒ Camdram::Show

Lookup a show by its ID or slug

Parameters:

  • id (Integer)

    The numeric ID of the show.

  • id (String)

    The slug of the show.

Returns:

Raises:

  • (ArgumentError)

    Error raised when an integer or string is not provided.



90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/camdram/client.rb', line 90

def get_show(id)
  url = nil
  if id.is_a? Integer
    url = "#{Show.url}/by-id/#{id}.json"
  elsif id.is_a? String
    url = "#{Show.url}/#{id}.json"
  else
    raise ArgumentError.new 'id must be an integer, or slug must be a string'
  end
  response = get(url)
  return Show.new(response)
end