Skip to content

Commit

Permalink
Add top_rentals, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
nmunson committed Feb 23, 2015
1 parent 0de6b54 commit 088c9ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Each object provides a find() method which accepts a number of options:

RottenList.find(:type => "upcoming", :limit => 10, :expand_results => true)

[:type] specifies a list type to retrieve. Valid options are 'box_office', 'in_theaters', 'opening', 'upcoming', 'new_releases'.
[:type] specifies a list type to retrieve. Valid options are 'box_office', 'in_theaters', 'opening', 'upcoming', 'new_releases', 'top_rentals'.
[:limit] see RottenMovie
[:expand_results] see RottenMovie

Expand Down
2 changes: 1 addition & 1 deletion lib/rottentomatoes/rotten_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RottenList

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])
if !["box_office", "in_theaters", "opening", "upcoming", "new_releases", "top_rentals"].include?(options[:type])
raise ArgumentError, ":type must be a recognized format"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rottentomatoes/rottentomatoes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.api_call(method, options)
end

if (method == "lists")
url += (options[:type] == "new_releases") ? "/dvds/" : "/movies/"
url += (options[:type] == "new_releases" || options[:type] == "top_rentals") ? "/dvds/" : "/movies/"
url += options[:type]
end

Expand Down

0 comments on commit 088c9ca

Please sign in to comment.