Class: Google::CustomSearch::JSON::Results::Page
- Inherits:
-
Object
- Object
- Google::CustomSearch::JSON::Results::Page
- Defined in:
- lib/google/custom_search/json/results.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(data) ⇒ Page
constructor
A new instance of Page.
- #start_index ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Page
Returns a new instance of Page.
48 49 50 |
# File 'lib/google/custom_search/json/results.rb', line 48 def initialize(data) @data = data[0] end |
Instance Method Details
#==(other) ⇒ Object
60 61 62 |
# File 'lib/google/custom_search/json/results.rb', line 60 def ==(other) other.start_index == start_index end |
#start_index ⇒ Object
52 53 54 |
# File 'lib/google/custom_search/json/results.rb', line 52 def start_index @data['startIndex'] end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/google/custom_search/json/results.rb', line 56 def to_s "results #{start_index}-#{end_index} of #{total}" end |