Method: Omdb::Api#fetch
- Defined in:
- lib/omdb/api.rb
#fetch(title, year = nil) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/omdb/api.rb', line 20 def fetch(title, year = nil) res = network.call({t: title, year: nil}) if res[:data]["Response"] == "False" response = {:status => 404} else response = { status: res[:code], movie: parse_movie(res[:data]) } end end |