Class: Liza::Address
- Inherits:
-
Object
- Object
- Liza::Address
- Defined in:
- lib/liza/address.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#coordinates ⇒ Object
readonly
Returns the value of attribute coordinates.
-
#crossing_street ⇒ Object
readonly
Returns the value of attribute crossing_street.
-
#locality ⇒ Object
readonly
Returns the value of attribute locality.
-
#normalized_address ⇒ Object
readonly
Returns the value of attribute normalized_address.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#street ⇒ Object
readonly
Returns the value of attribute street.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Address
constructor
A new instance of Address.
- #map_url ⇒ Object
- #to_s ⇒ Object
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
#area ⇒ Object (readonly)
Returns the value of attribute area.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def area @area end |
#coordinates ⇒ Object (readonly)
Returns the value of attribute coordinates.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def coordinates @coordinates end |
#crossing_street ⇒ Object (readonly)
Returns the value of attribute crossing_street.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def crossing_street @crossing_street end |
#locality ⇒ Object (readonly)
Returns the value of attribute locality.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def locality @locality end |
#normalized_address ⇒ Object (readonly)
Returns the value of attribute normalized_address.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def normalized_address @normalized_address end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/liza/address.rb', line 3 def number @number end |
#street ⇒ Object (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_url ⇒ Object
20 21 22 |
# File 'lib/liza/address.rb', line 20 def map_url "https://www.google.com/maps/search/#{coordinates.join(',')}" end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/liza/address.rb', line 16 def to_s normalized_address end |