Class: Imdb::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/imdb/search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query = {}) ⇒ Search

Initialize a new IMDB search with the specified query

search = Imdb::Search.new(:title => "True Grit", :year => "1969")


10
11
12
# File 'lib/imdb/search.rb', line 10

def initialize(query={})
  @query = query
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



3
4
5
# File 'lib/imdb/search.rb', line 3

def query
  @query
end

Instance Method Details

#movieObject

Return new Imdb::Movie object with json hash as attributes



17
18
19
# File 'lib/imdb/search.rb', line 17

def movie
  @movie ||= parse_json
end