Class: Google::CustomSearch::JSON::Results::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/google/custom_search/json/results.rb

Instance Method Summary collapse

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_indexObject



52
53
54
# File 'lib/google/custom_search/json/results.rb', line 52

def start_index
  @data['startIndex']
end

#to_sObject



56
57
58
# File 'lib/google/custom_search/json/results.rb', line 56

def to_s
  "results #{start_index}-#{end_index} of #{total}"
end