A Point object is valid if
- it has a lattitude within the minimum and maximum lattitude values
- it has a longitude within the minimum and maximum longitude values
Included modules
- Validation
Constants
| MAX_LONGITUDE | = | 180 |
| MIN_LONGITUDE | = | -180 |
| MAX_LATTITUDE | = | 90 |
| MIN_LATTITUDE | = | -90 |
Attributes
| lattitude | [RW] | |
| longitude | [RW] |
Public class methods
new
( attributes = {} )
[show source]
# File lib/rcap/cap_1_0/point.rb, line 21 def initialize( attributes = {} ) @lattitude = attributes[ :lattitude ] @longitude = attributes[ :longitude ] end
Public instance methods
==
( other )
Two points are equivalent if they have the same lattitude and longitude
[show source]
# File lib/rcap/cap_1_0/point.rb, line 37 def ==( other ) [ self.lattitude, self.longitude ] == [ other.lattitude, other.longitude ] end
to_s
()
Returns a string representation of the point of the form
lattitude,longitude
[show source]
# File lib/rcap/cap_1_0/point.rb, line 28 def to_s "#{ self.lattitude },#{ self.longitude }" end