Class: SimpleGoogleCustomSearch::ResultSet
- Inherits:
-
Object
- Object
- SimpleGoogleCustomSearch::ResultSet
- Defined in:
- lib/simple_google_custom_search/result_set.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#total ⇒ Object
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ ResultSet
constructor
A new instance of ResultSet.
Constructor Details
#initialize(attrs = {}) ⇒ ResultSet
Returns a new instance of ResultSet.
4 5 6 7 |
# File 'lib/simple_google_custom_search/result_set.rb', line 4 def initialize(attrs={}) @total = attrs[:total] || 0 @item = attrs[:item] || [] end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
2 3 4 |
# File 'lib/simple_google_custom_search/result_set.rb', line 2 def item @item end |
#total ⇒ Object
Returns the value of attribute total.
2 3 4 |
# File 'lib/simple_google_custom_search/result_set.rb', line 2 def total @total end |
Class Method Details
.create_empty ⇒ Object
9 10 11 12 13 14 |
# File 'lib/simple_google_custom_search/result_set.rb', line 9 def self.create_empty self.new({ total: 0, item: [] }) end |