Class: Liza::Address

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ Address

Returns a new instance of Address.



6
7
8
9
10
11
12
13
14
# File 'lib/liza/address.rb', line 6

def initialize(arguments)
  @number = arguments["altura"]
  @coordinates = arguments["coordenadas"].values_at("y", "x").map(&:to_f)
  @normalized_address = arguments["direccion"]
  @street = arguments["nombre_calle"]
  @crossing_street = arguments["nombre_calle_cruce"]
  @locality = arguments["nombre_localidad"]
  @area = arguments["nombre_partido"]
end

Instance Attribute Details

#areaObject (readonly)

Returns the value of attribute area.



3
4
5
# File 'lib/liza/address.rb', line 3

def area
  @area
end

#coordinatesObject (readonly)

Returns the value of attribute coordinates.



3
4
5
# File 'lib/liza/address.rb', line 3

def coordinates
  @coordinates
end

#crossing_streetObject (readonly)

Returns the value of attribute crossing_street.



3
4
5
# File 'lib/liza/address.rb', line 3

def crossing_street
  @crossing_street
end

#localityObject (readonly)

Returns the value of attribute locality.



3
4
5
# File 'lib/liza/address.rb', line 3

def locality
  @locality
end

#normalized_addressObject (readonly)

Returns the value of attribute normalized_address.



3
4
5
# File 'lib/liza/address.rb', line 3

def normalized_address
  @normalized_address
end

#numberObject (readonly)

Returns the value of attribute number.



3
4
5
# File 'lib/liza/address.rb', line 3

def number
  @number
end

#streetObject (readonly)

Returns the value of attribute street.



3
4
5
# File 'lib/liza/address.rb', line 3

def street
  @street
end

Instance Method Details

#map_urlObject



20
21
22
# File 'lib/liza/address.rb', line 20

def map_url
  "https://www.google.com/maps/search/#{coordinates.join(',')}"
end

#to_sObject



16
17
18
# File 'lib/liza/address.rb', line 16

def to_s
  normalized_address
end