Class: Geon::GeoObject

Inherits:
BasicObject
Defined in:
lib/geon/geo_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGeoObject

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

#addressObject

Returns the value of attribute address.



6
7
8
# File 'lib/geon/geo_object.rb', line 6

def address
  @address
end

#coordObject

Returns the value of attribute coord.



6
7
8
# File 'lib/geon/geo_object.rb', line 6

def coord
  @coord
end

#detailObject

Returns the value of attribute detail.



6
7
8
# File 'lib/geon/geo_object.rb', line 6

def detail
  @detail
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/geon/geo_object.rb', line 6

def type
  @type
end

Instance Method Details

#latitudeObject



19
20
21
# File 'lib/geon/geo_object.rb', line 19

def latitude
  @coord[0]
end

#longitudeObject



15
16
17
# File 'lib/geon/geo_object.rb', line 15

def longitude
  @coord[1]
end

#to_hashObject



23
24
25
# File 'lib/geon/geo_object.rb', line 23

def to_hash
  {coord: @coord, type: @type, address: @address, detail: @detail}
end