Module: Google::Geo::Parser
Instance Method Summary collapse
-
#fetch(element) ⇒ Object
Fetch contents of an XML element of the response.
-
#fetch_accuracy ⇒ Object
Like fetch, but for the only piece of data locked away in an attribute.
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_accuracy ⇒ Object
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 |