lib/fandango.rb in fandango-0.1.9 vs lib/fandango.rb in fandango-0.2.0
- old
+ new
@@ -20,11 +20,19 @@
end
private
def fetch_and_parse(postal_code)
- Feedzirra::Feed.fetch_and_parse("http://www.fandango.com/rss/moviesnearme_#{postal_code}.rss")
+ feed = Feedzirra::Feed.fetch_and_parse("http://www.fandango.com/rss/moviesnearme_#{postal_code}.rss")
+ raise BadResponse.new(feed) unless feed.respond_to?(:entries)
+ feed
end
+ end
+
+ class BadResponse < StandardError
+ def initialize(response)
+ super "Bad response: #{response.inspect}"
+ end
end
end