Class: Geon::GeoObject
- Inherits:
- BasicObject
- Defined in:
- lib/geon/geo_object.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#coord ⇒ Object
Returns the value of attribute coord.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize ⇒ GeoObject
constructor
A new instance of GeoObject.
- #latitude ⇒ Object
- #longitude ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ GeoObject
Returns a new instance of GeoObject.
8 9 10 11 12 13 |
# File 'lib/geon/geo_object.rb', line 8 def initialize @coord = [0, 0] @type = :house @address = '' @detail = {} end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
6 7 8 |
# File 'lib/geon/geo_object.rb', line 6 def address @address end |
#coord ⇒ Object
Returns the value of attribute coord.
6 7 8 |
# File 'lib/geon/geo_object.rb', line 6 def coord @coord end |
#detail ⇒ Object
Returns the value of attribute detail.
6 7 8 |
# File 'lib/geon/geo_object.rb', line 6 def detail @detail end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/geon/geo_object.rb', line 6 def type @type end |
Instance Method Details
#latitude ⇒ Object
19 20 21 |
# File 'lib/geon/geo_object.rb', line 19 def latitude @coord[0] end |
#longitude ⇒ Object
15 16 17 |
# File 'lib/geon/geo_object.rb', line 15 def longitude @coord[1] end |
#to_hash ⇒ Object
23 24 25 |
# File 'lib/geon/geo_object.rb', line 23 def to_hash {coord: @coord, type: @type, address: @address, detail: @detail} end |