A Circle object is valid if
- it has a valid lattitude and longitude
- it has a radius with a value greater than zero
Included modules
- Validation
Attributes
| radius | [RW] | Expresed in kilometers |
Public class methods
new
( attributes = {} )
[show source]
# File lib/rcap/cap_1_0/circle.rb, line 19 def initialize( attributes = {} ) super( attributes ) @radius = attributes[ :radius ] end
Public instance methods
==
( other )
Two circles are equivalent if their lattitude, longitude and radius are equal.
[show source]
# File lib/rcap/cap_1_0/circle.rb, line 58 def ==( other ) [ self.lattitude, self.longitude, self.radius ] == [ other.lattitude, other.longitude, other.radius ] end