Class: RottenTomatoes::RottenList

Inherits:
Object
  • Object
show all
Defined in:
lib/rottentomatoes/rotten_list.rb

Class Method Summary collapse

Class Method Details

.find(options) ⇒ Object

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rottentomatoes/rotten_list.rb', line 5

def self.find(options)
  raise ArgumentError, ":type must be set" if (options[:type].nil?)
  if !["box_office", "in_theaters", "opening", "upcoming", "new_releases"].include?(options[:type])
    raise ArgumentError, ":type must be a recognized format"
  end

  results = []
  results << Rotten.api_call("lists", options)

  return Rotten.process_results(results, options)
end