Class: Imdb::Search
Overview
Search IMDB for a title
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query) ⇒ Search
constructor
Initialize a new IMDB search with the specified query.
-
#movies ⇒ Object
Returns an array of Imdb::Movie objects for easy search result yielded.
Constructor Details
#initialize(query) ⇒ Search
14 15 16 |
# File 'lib/imdb/search.rb', line 14 def initialize(query) @query = query end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
5 6 7 |
# File 'lib/imdb/search.rb', line 5 def query @query end |
Instance Method Details
#movies ⇒ Object
Returns an array of Imdb::Movie objects for easy search result yielded. If the query
was an exact match, a single element array will be returned.
20 21 22 |
# File 'lib/imdb/search.rb', line 20 def movies @movies ||= (exact_match? ? parse_movie : parse_movies) end |