Class: Chebyte::Location
- Inherits:
-
Object
- Object
- Chebyte::Location
- Defined in:
- lib/ruby-yql.rb
Instance Method Summary collapse
- #coords ⇒ Object
-
#initialize(response) ⇒ Location
constructor
A new instance of Location.
- #latitude ⇒ Object
- #longitude ⇒ Object
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
#coords ⇒ Object
137 138 139 |
# File 'lib/ruby-yql.rb', line 137 def coords "#{latitude}, #{longitude}" end |
#latitude ⇒ Object
129 130 131 |
# File 'lib/ruby-yql.rb', line 129 def latitude (@response/"centroid").each{|location| return (location/"latitude").text} end |
#longitude ⇒ Object
133 134 135 |
# File 'lib/ruby-yql.rb', line 133 def longitude (@response/"centroid").each{|location| return (location/"longitude").text} end |