Class: MiamiDadeGeo::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/miami_dade_geo/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address) ⇒ Address



9
10
11
# File 'lib/miami_dade_geo/address.rb', line 9

def initialize(address)
  @address = address
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



7
8
9
# File 'lib/miami_dade_geo/address.rb', line 7

def address
  @address
end

Instance Method Details

#latObject



29
30
31
# File 'lib/miami_dade_geo/address.rb', line 29

def lat
  @lat ||= latlong[:lat]
end

#longObject



33
34
35
# File 'lib/miami_dade_geo/address.rb', line 33

def long
  @long ||= latlong[:long]
end

#munic_codeObject



25
26
27
# File 'lib/miami_dade_geo/address.rb', line 25

def munic_code
  @munic_code ||= xy_addr[:munic_code].to_i
end

#municipalityObject



37
38
39
# File 'lib/miami_dade_geo/address.rb', line 37

def municipality
  @municipality ||= Municipality.new_with_code(munic_code)
end

#xObject



13
14
15
# File 'lib/miami_dade_geo/address.rb', line 13

def x
  @x ||= xy_addr[:x].to_f
end

#yObject



17
18
19
# File 'lib/miami_dade_geo/address.rb', line 17

def y
  @y ||= xy_addr[:y].to_f
end

#zipObject



21
22
23
# File 'lib/miami_dade_geo/address.rb', line 21

def zip
  @zip ||= xy_addr[:zip_code].to_i
end