Class: Google::CustomSearch::XML::Results::Page

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xml(node) ⇒ Object



51
52
53
54
55
56
# File 'lib/google/custom_search/xml/results.rb', line 51

def self.from_xml(node)
  new(
    node.attributes['SN'].text.to_i,
    node.attributes['EN'].text.to_i,
    node.search('M').text.to_i)
end

Instance Method Details

#==(other) ⇒ Object



62
63
64
# File 'lib/google/custom_search/xml/results.rb', line 62

def ==(other)
  other.start_index == start_index
end

#to_sObject



58
59
60
# File 'lib/google/custom_search/xml/results.rb', line 58

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