Class: Google::CustomSearch::XML::Result

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

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Result

Returns a new instance of Result.



71
72
73
# File 'lib/google/custom_search/xml/results.rb', line 71

def initialize(node)
  @node = node
end

Instance Method Details

#contentObject



83
84
85
# File 'lib/google/custom_search/xml/results.rb', line 83

def content
  @node.search('S').text
end

#siteObject



87
88
89
# File 'lib/google/custom_search/xml/results.rb', line 87

def site
  URI.parse(@node.search('U').text).host
end

#titleObject



75
76
77
# File 'lib/google/custom_search/xml/results.rb', line 75

def title
  @node.search('T').text
end

#uriObject



79
80
81
# File 'lib/google/custom_search/xml/results.rb', line 79

def uri
  @node.search('U').text
end