Class: Rlocu::Location
- Inherits:
-
Object
- Object
- Rlocu::Location
- Defined in:
- lib/utilities.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#long ⇒ Object
Returns the value of attribute long.
Instance Method Summary collapse
-
#initialize(lat, long) ⇒ Location
constructor
A new instance of Location.
- #to_s ⇒ Object
Constructor Details
#initialize(lat, long) ⇒ Location
13 14 15 16 17 18 19 |
# File 'lib/utilities.rb', line 13 def initialize(lat, long) if !lat.is_a?(Numeric) || !long.is_a?(Numeric) raise ArgumentError.new "Lat and long must be numeric (floats)" end @lat = lat @long = long end |
Instance Attribute Details
#lat ⇒ Object
Returns the value of attribute lat.
11 12 13 |
# File 'lib/utilities.rb', line 11 def lat @lat end |
#long ⇒ Object
Returns the value of attribute long.
11 12 13 |
# File 'lib/utilities.rb', line 11 def long @long end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/utilities.rb', line 21 def to_s "#{lat},#{long}" end |