Class RCAP::CAP_1_0::Circle

  1. lib/rcap/cap_1_0/circle.rb

A Circle object is valid if

  • it has a valid lattitude and longitude
  • it has a radius with a value greater than zero

Methods

public class

  1. new

public instance

  1. ==

Included modules

  1. 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