Module: Google::Geo::Parser

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#fetch(element) ⇒ Object

Fetch contents of an XML element of the response.



59
60
61
# File 'lib/google/geo.rb', line 59

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

#fetch_accuracyObject

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



64
65
66
# File 'lib/google/geo.rb', line 64

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