Class: Weese::Location::RadiusAtCoordinates
- Inherits:
-
Object
- Object
- Weese::Location::RadiusAtCoordinates
- Defined in:
- lib/weese/location.rb
Overview
A radius in meters at a Coordinates
Instance Attribute Summary collapse
-
#coordinates ⇒ Coordinates
A latitude and longitude.
-
#radius ⇒ Numeric
Radius in meters around coordinates.
Instance Method Summary collapse
-
#initialize(radius, coordinates) ⇒ RadiusAtCoordinates
constructor
Create a Radius at a Coordinates.
-
#to_h ⇒ Hash
Converts this object to a hash.
Constructor Details
#initialize(radius, coordinates) ⇒ RadiusAtCoordinates
Create a Radius at a Coordinates
19 20 21 22 |
# File 'lib/weese/location.rb', line 19 def initialize(radius, coordinates) @radius = radius @coordinates = coordinates end |
Instance Attribute Details
#coordinates ⇒ Coordinates
Returns A latitude and longitude.
11 12 13 |
# File 'lib/weese/location.rb', line 11 def coordinates @coordinates end |
#radius ⇒ Numeric
Returns Radius in meters around coordinates.
9 10 11 |
# File 'lib/weese/location.rb', line 9 def radius @radius end |
Instance Method Details
#to_h ⇒ Hash
Converts this object to a hash
29 30 31 32 33 34 35 |
# File 'lib/weese/location.rb', line 29 def to_h { radius: radius, latitude: coordinates.latitude, longitude: coordinates.longitude } end |