Class: Gugl::Search::ResultItem
- Inherits:
-
Object
- Object
- Gugl::Search::ResultItem
- Defined in:
- lib/search/result_item.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(plain_item) ⇒ ResultItem
constructor
A new instance of ResultItem.
Constructor Details
#initialize(plain_item) ⇒ ResultItem
Returns a new instance of ResultItem.
6 7 8 9 10 |
# File 'lib/search/result_item.rb', line 6 def initialize(plain_item) @title = plain_item['title'] @snippet = plain_item['snippet'].gsub(/\s{2,}/, ' ') @link = plain_item['link'] end |
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
4 5 6 |
# File 'lib/search/result_item.rb', line 4 def link @link end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
4 5 6 |
# File 'lib/search/result_item.rb', line 4 def snippet @snippet end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/search/result_item.rb', line 4 def title @title end |