Class: Chebyte::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-yql.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Location

Returns a new instance of Location.



125
126
127
# File 'lib/ruby-yql.rb', line 125

def initialize(response)
  @response = response
end

Instance Method Details

#coordsObject



137
138
139
# File 'lib/ruby-yql.rb', line 137

def coords
  "#{latitude}, #{longitude}"
end

#latitudeObject



129
130
131
# File 'lib/ruby-yql.rb', line 129

def latitude
  (@response/"centroid").each{|location| return (location/"latitude").text}
end

#longitudeObject



133
134
135
# File 'lib/ruby-yql.rb', line 133

def longitude
  (@response/"centroid").each{|location| return (location/"longitude").text}
end