Class: VORuby::STC::V1_10::STC::SpectralFrameType

Inherits:
CoordFrameType show all
Defined in:
lib/voruby/stc/1.10/stc.rb

Overview

ontains the spectral frame reference position

Direct Known Subclasses

SpectralFrame

Instance Attribute Summary collapse

Attributes inherited from CoordFrameType

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(options = {}) ⇒ SpectralFrameType

Returns a new instance of SpectralFrameType.



1268
1269
1270
1271
# File 'lib/voruby/stc/1.10/stc.rb', line 1268

def initialize(options={})
  raise_argument_required_error('reference position') if !options.has_key?(:reference_position)
  super(options)
end

Instance Attribute Details

#reference_positionObject

Returns the value of attribute reference_position.



1266
1267
1268
# File 'lib/voruby/stc/1.10/stc.rb', line 1266

def reference_position
  @reference_position
end

Class Method Details

.from_xml(xml) ⇒ Object



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
# File 'lib/voruby/stc/1.10/stc.rb', line 1291

def self.from_xml(xml)
  root = element_from(xml)
  
  options = {
    :reference_position => xml_to_obj(root, ReferencePosition, true)
  }
  
  name = REXML::XPath.first(root, 'x:Name', {'x' => obj_ns.uri})
  options[:name] = name.text if name
  
  self.new(options)
end

Instance Method Details

#==(p) ⇒ Object



1280
1281
1282
# File 'lib/voruby/stc/1.10/stc.rb', line 1280

def ==(p)
  super(p) and self.reference_position == p.reference_position
end

#to_xml(name = nil) ⇒ Object



1284
1285
1286
1287
1288
1289
# File 'lib/voruby/stc/1.10/stc.rb', line 1284

def to_xml(name=nil)
  el = super(name)
  el.add_element(self.reference_position.to_xml)
  collapse_namespaces(el)
  el
end