Class: CubeSmart::Geocode
- Inherits:
-
Object
- Object
- CubeSmart::Geocode
- Defined in:
- lib/cubesmart/geocode.rb
Overview
The geocode (latitude + longitude) of a facility.
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(latitude:, longitude:) ⇒ Geocode
constructor
A new instance of Geocode.
- #inspect ⇒ String
- #text ⇒ String
Constructor Details
#initialize(latitude:, longitude:) ⇒ Geocode
Returns a new instance of Geocode.
16 17 18 19 |
# File 'lib/cubesmart/geocode.rb', line 16 def initialize(latitude:, longitude:) @latitude = latitude @longitude = longitude end |
Instance Attribute Details
#latitude ⇒ Float
8 9 10 |
# File 'lib/cubesmart/geocode.rb', line 8 def latitude @latitude end |
#longitude ⇒ Float
12 13 14 |
# File 'lib/cubesmart/geocode.rb', line 12 def longitude @longitude end |
Class Method Details
.parse(data:) ⇒ Geocode
38 39 40 41 42 43 |
# File 'lib/cubesmart/geocode.rb', line 38 def self.parse(data:) new( latitude: data['latitude'], longitude: data['longitude'] ) end |
Instance Method Details
#inspect ⇒ String
22 23 24 25 26 27 28 |
# File 'lib/cubesmart/geocode.rb', line 22 def inspect props = [ "latitude=#{@latitude.inspect}", "longitude=#{@longitude.inspect}" ] "#<#{self.class.name} #{props.join(' ')}>" end |
#text ⇒ String
31 32 33 |
# File 'lib/cubesmart/geocode.rb', line 31 def text "#{@latitude},#{@longitude}" end |