Class: Is::Point
- Inherits:
-
Object
- Object
- Is::Point
- Defined in:
- lib/is/point.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
- #in?(area) ⇒ Boolean
-
#initialize(lat, long) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(lat, long) ⇒ Point
Returns a new instance of Point.
6 7 8 9 |
# File 'lib/is/point.rb', line 6 def initialize(lat, long) @latitude = lat.to_f @longitude = long.to_f end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
4 5 6 |
# File 'lib/is/point.rb', line 4 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/is/point.rb', line 4 def longitude @longitude end |