Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panda Tiger Eagle #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Panda Tiger Eagle #6

wants to merge 5 commits into from

Conversation

seejohnplay
Copy link

No description provided.

@@ -9,6 +9,7 @@ class Api
def self.search_by_title(title)
url = "http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=#{APIKEY}&q=#{URI.encode(title)}&page_limit=1"
struct = OpenStruct.new(get_url_as_json(url).fetch("movies").first)
return false if struct.title == nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor note: I don't love the use of a false here to indicate that nothing was found. This could be referred to as "primitive obsession". It gets the job done, but a different class like NilMovie might be "better"

@jwo
Copy link
Member

jwo commented Nov 27, 2012

Works really really well! Great job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants