Class: VORuby::STC::V1_30::CoordFrameType
- Inherits:
-
STCBaseType
- Object
- STCBaseType
- VORuby::STC::V1_30::CoordFrameType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
A CoordFrame has to have at least an Id.
Direct Known Subclasses
GenericCoordFrameType, RedshiftFrameType, SpaceFrameType, SpectralFrameType, TimeFrameType
Instance Attribute Summary collapse
-
#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
- #==(f) ⇒ Object
-
#initialize(name, options = {}) ⇒ CoordFrameType
constructor
A new instance of CoordFrameType.
- #to_xml(el_name = nil) ⇒ Object
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(name, options = {}) ⇒ CoordFrameType
Returns a new instance of CoordFrameType.
6272 6273 6274 6275 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6272 def initialize(name, ={}) super() self.name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6270 6271 6272 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6270 def name @name end |
Class Method Details
.coord_frame_from_xml(root) ⇒ Object
6298 6299 6300 6301 6302 6303 6304 6305 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6298 def self.coord_frame_from_xml(root) name = REXML::XPath.first(root, 'x:Name', {'x' => obj_ns.uri}) [ name ? name.text : nil, STCBaseType.stc_base_from_xml(root) ] end |
.from_xml(xml) ⇒ Object
6307 6308 6309 6310 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6307 def self.from_xml(xml) root = element_from(xml) self.new(*coord_frame_from_xml(root)) end |
Instance Method Details
#==(f) ⇒ Object
6281 6282 6283 6284 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6281 def ==(f) super(f) and self.name == f.name end |
#to_xml(el_name = nil) ⇒ Object
6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 |
# File 'lib/voruby/stc/1.30/stc.rb', line 6286 def to_xml(el_name=nil) el = super(el_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 end |