An Area object is valid if
Included modules
- Validation
Attributes
Public class methods
# File lib/rcap/cap_1_2/area.rb, line 39 def initialize( attributes = {}) @area_desc = attributes[ :area_desc ] @altitude = attributes[ :altitude ] @ceiling = attributes[ :ceiling ] @circles = Array( attributes[ :circles ]) @geocodes = Array( attributes[ :geocodes ]) @polygons = Array( attributes[ :polygons ]) end
Public instance methods
Implements an equality operator for the Area object. Two Area objects are equal if all their attributes are equal.
# File lib/rcap/cap_1_2/area.rb, line 92 def ==( other ) comparison_attributes = lambda{ |area| [ area.area_desc, area.altitude, area.ceiling, area.circles, area.geocodes, area.polygons ]} comparison_attributes.call( self ) == comparison_attributes.call( other ) end
Creates a new Circle object and adds it to the circles array. The circle_attributes are passed as a parameter to Circle.new.
# File lib/rcap/cap_1_2/area.rb, line 58 def add_circle( circle_attributes = {}) circle = Circle.new( circle_attributes ) self.circles << circle circle end
Creates a new Geocode object and adds it to the geocodes array. The geocode_attributes are passed as a parameter to Geocode.new.
# File lib/rcap/cap_1_2/area.rb, line 66 def add_geocode( geocode_attributes = {}) geocode = Geocode.new( geocode_attributes ) self.geocodes << geocode geocode end
Creates a new Polygon object and adds it to the polygons array. The polygon_attributes are passed as a parameter to Polygon.new.
# File lib/rcap/cap_1_2/area.rb, line 50 def add_polygon( polygon_attributes = {}) polygon = Polygon.new( polygon_attributes ) self.polygons << polygon polygon end
Returns a string representation of the area of the form
area_desc
# File lib/rcap/cap_1_2/area.rb, line 108 def to_s self.area_desc end