Class: VORuby::STC::V1_30::CoordinateType
- Inherits:
-
STCBaseType
- Object
- STCBaseType
- VORuby::STC::V1_30::CoordinateType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
Abstract coordinate type; a concrete Coordinate consists of a Value, Error, Resolution, Size, and PixSize.
Direct Known Subclasses
AstroCoordsFileType, BasicCoordinateType, OrbitType, PixelVector1CoordinateType, PixelVector2CoordinateType, PixelVector3CoordinateType, StringCoordinateType, TimeCoordinateType, Vector2CoordinateType, Vector3CoordinateType
Instance Attribute Summary collapse
-
#frame_id ⇒ Object
Returns the value of attribute frame_id.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from STCBaseType
#==, #initialize, stc_base_from_xml
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
This class inherits a constructor from VORuby::STC::V1_30::STCBaseType
Instance Attribute Details
#frame_id ⇒ Object
Returns the value of attribute frame_id.
1422 1423 1424 |
# File 'lib/voruby/stc/1.30/stc.rb', line 1422 def frame_id @frame_id end |
#name ⇒ Object
Returns the value of attribute name.
1422 1423 1424 |
# File 'lib/voruby/stc/1.30/stc.rb', line 1422 def name @name end |
Class Method Details
.coordinate_from_xml(xml) ⇒ Object
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 |
# File 'lib/voruby/stc/1.30/stc.rb', line 1446 def self.coordinate_from_xml(xml) root = element_from(xml) = STCBaseType.stc_base_from_xml(root) name = REXML::XPath.first(root, 'x:Name', {'x' => obj_ns.uri}) [:name] = name.text if name frame_id = root.attributes.get_attribute_ns(obj_ns.uri, 'frame_id') [:frame_id] = IdRef.new(frame_id.value) if frame_id end |
Instance Method Details
#to_xml(name = nil) ⇒ Object
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 |
# File 'lib/voruby/stc/1.30/stc.rb', line 1432 def to_xml(name=nil) el = super(name) if self.name name_el = REXML::Element.new("#{obj_ns.prefix}:Name") name_el.text = self.name el.add_element(name_el) end el.attributes["#{obj_ns.prefix}:frame_id"] = self.frame_id.to_s if self.frame_id el end |