Class: AlleJest::SearchResult
- Inherits:
-
Object
- Object
- AlleJest::SearchResult
- Includes:
- HasAttributes
- Defined in:
- lib/allejest.rb
Instance Attribute Summary collapse
-
#feed ⇒ Object
Returns the value of attribute feed.
-
#items ⇒ Object
Returns the value of attribute items.
-
#query ⇒ Object
Returns the value of attribute query.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ SearchResult
constructor
A new instance of SearchResult.
-
#matches_query? ⇒ Boolean
TODO support non-text queries as well.
- #old_initialize ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ SearchResult
Returns a new instance of SearchResult.
54 55 56 57 58 59 |
# File 'lib/allejest.rb', line 54 def initialize(args = {}) self.items = [] old_initialize(args) self.title = feed.title.sub("Allegro.pl: ", "") end |
Instance Attribute Details
#feed ⇒ Object
Returns the value of attribute feed.
50 51 52 |
# File 'lib/allejest.rb', line 50 def feed @feed end |
#items ⇒ Object
Returns the value of attribute items.
50 51 52 |
# File 'lib/allejest.rb', line 50 def items @items end |
#query ⇒ Object
Returns the value of attribute query.
50 51 52 |
# File 'lib/allejest.rb', line 50 def query @query end |
#title ⇒ Object
Returns the value of attribute title.
50 51 52 |
# File 'lib/allejest.rb', line 50 def title @title end |
Instance Method Details
#matches_query? ⇒ Boolean
TODO support non-text queries as well. Write a better matcher after all…
62 63 64 |
# File 'lib/allejest.rb', line 62 def matches_query? self.title == query[:text] end |
#old_initialize ⇒ Object
52 |
# File 'lib/allejest.rb', line 52 alias_method :old_initialize, :initialize |