Class: Periplus::Location
- Inherits:
-
BingResponse
- Object
- BingResponse
- Periplus::Location
- Defined in:
- lib/periplus/location.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#confidence ⇒ Object
Returns the value of attribute confidence.
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
Instance Method Summary collapse
Methods inherited from BingResponse
Constructor Details
This class inherits a constructor from Periplus::BingResponse
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
5 6 7 |
# File 'lib/periplus/location.rb', line 5 def address @address end |
#confidence ⇒ Object
Returns the value of attribute confidence.
6 7 8 |
# File 'lib/periplus/location.rb', line 6 def confidence @confidence end |
#entity_type ⇒ Object
Returns the value of attribute entity_type.
7 8 9 |
# File 'lib/periplus/location.rb', line 7 def entity_type @entity_type end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/periplus/location.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/periplus/location.rb', line 4 def longitude @longitude end |
Instance Method Details
#parse ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/periplus/location.rb', line 9 def parse super() point = @primary_resource["point"] @latitude, @longitude = point["coordinates"] @address= @primary_resource["address"] @confidence = @primary_resource["confidence"].downcase.to_sym @entity_type = @primary_resource["entityType"].downcase.to_sym end |