Class: VORuby::STC::V1_10::Region::Shape
- Inherits:
-
RegionType
- Object
- RegionType
- VORuby::STC::V1_10::Region::Shape
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.10/region.rb
Overview
Shape is the abstract type that is the building block of regions; in real life it needs to be replaced by a concrete shape
Direct Known Subclasses
CircleType, ConvexHullType, ConvexType, PolygonType, SectorType, SkyIndexType
Instance Attribute Summary collapse
-
#coord_system_id ⇒ Object
Returns the value of attribute coord_system_id.
-
#unit ⇒ Object
Returns the value of attribute unit.
Attributes inherited from RegionType
Instance Method Summary collapse
- #==(s) ⇒ Object
-
#initialize(options = {}) ⇒ Shape
constructor
A new instance of Shape.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Methods inherited from RegionType
#fill_factor, #fill_factor=, from_xml
Constructor Details
#initialize(options = {}) ⇒ Shape
Returns a new instance of Shape.
74 75 76 77 |
# File 'lib/voruby/stc/1.10/region.rb', line 74 def initialize(={}) raise_argument_required_error('coord system id') if !.has_key?(:coord_system_id) .each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#coord_system_id ⇒ Object
Returns the value of attribute coord_system_id.
72 73 74 |
# File 'lib/voruby/stc/1.10/region.rb', line 72 def coord_system_id @coord_system_id end |
#unit ⇒ Object
Returns the value of attribute unit.
72 73 74 |
# File 'lib/voruby/stc/1.10/region.rb', line 72 def unit @unit end |
Instance Method Details
#==(s) ⇒ Object
94 95 96 97 |
# File 'lib/voruby/stc/1.10/region.rb', line 94 def ==(s) self.coord_system_id == s.coord_system_id and self.unit == s.unit end |
#to_xml(name = nil) ⇒ Object
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/voruby/stc/1.10/region.rb', line 99 def to_xml(name=nil) el = super(name) el.attributes["#{obj_ns.prefix}:coord_system_id"] = self.coord_system_id.to_s el.attributes["#{obj_ns.prefix}:unit"] = self.unit.to_s if self.unit collapse_namespaces(el) el end |