Class: ImdbCelebrity::Search
- Inherits:
-
Object
- Object
- ImdbCelebrity::Search
- Defined in:
- lib/imdb_celebrity/search.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #celebrities ⇒ Object
-
#initialize(query, parser = "HpricotParser") ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(query, parser = "HpricotParser") ⇒ Search
Returns a new instance of Search.
9 10 11 12 13 |
# File 'lib/imdb_celebrity/search.rb', line 9 def initialize(query, parser ="HpricotParser") @query = search_uri query @parser_text = parser @parser = initialize_parser parser end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
7 8 9 |
# File 'lib/imdb_celebrity/search.rb', line 7 def parser @parser end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
7 8 9 |
# File 'lib/imdb_celebrity/search.rb', line 7 def query @query end |
Instance Method Details
#celebrities ⇒ Object
15 16 17 |
# File 'lib/imdb_celebrity/search.rb', line 15 def celebrities @celebrities = (@parser.exact_match? ? @parser.parse_celebrity : parse_celebrities) end |