Module: Google::Geo::Parser

Included in:
Address, Response
Defined in:
lib/google/geo/parser.rb

Instance Method Summary collapse

Instance Method Details

#fetch(element) ⇒ Object

Fetch contents of an XML element of the response.



7
8
9
# File 'lib/google/geo/parser.rb', line 7

def fetch(element)
  @xml.slice(%r{<#{element}>(.+?)</#{element}>}, 1)
end

#fetch_accuracyObject

Like fetch, but for the only piece of data locked away in an attribute.



12
13
14
# File 'lib/google/geo/parser.rb', line 12

def fetch_accuracy
  @xml.slice(%r{Accuracy="([^"]+)"}, 1).to_i
end