Class: VORuby::STC::V1_30::RedshiftFrameType
- Inherits:
-
CoordFrameType
- Object
- STCBaseType
- CoordFrameType
- VORuby::STC::V1_30::RedshiftFrameType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
Contains the Doppler definitions, including whether the values are velocity or redshift (value_type).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#doppler_definition ⇒ Object
Returns the value of attribute doppler_definition.
-
#reference_position ⇒ Object
Returns the value of attribute reference_position.
-
#value_type ⇒ Object
Returns the value of attribute value_type.
Attributes inherited from CoordFrameType
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
- #==(f) ⇒ Object
-
#initialize(reference_position, doppler_definition = nil, value_type = ValueType.new('VELOCITY'), name = nil, options = {}) ⇒ RedshiftFrameType
constructor
A new instance of RedshiftFrameType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from CoordFrameType
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(reference_position, doppler_definition = nil, value_type = ValueType.new('VELOCITY'), name = nil, options = {}) ⇒ RedshiftFrameType
Returns a new instance of RedshiftFrameType.
7850 7851 7852 7853 7854 7855 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7850 def initialize(reference_position, doppler_definition=nil, value_type=ValueType.new('VELOCITY'), name=nil, ={}) super(name, ) self.reference_position = reference_position self.doppler_definition = doppler_definition self.value_type = value_type || ValueType.new('VELOCITY') end |
Instance Attribute Details
#doppler_definition ⇒ Object
Returns the value of attribute doppler_definition.
7848 7849 7850 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7848 def doppler_definition @doppler_definition end |
#reference_position ⇒ Object
Returns the value of attribute reference_position.
7848 7849 7850 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7848 def reference_position @reference_position end |
#value_type ⇒ Object
Returns the value of attribute value_type.
7848 7849 7850 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7848 def value_type @value_type end |
Class Method Details
.from_xml(xml) ⇒ Object
7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7905 def self.from_xml(xml) root = element_from(xml) dd = REXML::XPath.first(root, 'x:DopplerDefinition', {'x' => obj_ns.uri}) vt = root.attributes.get_attribute_ns(obj_ns.uri, 'value_type') self.new( xml_to_obj(root, ReferencePosition, true), dd ? DopplerDefinitionType.new(dd.text) : nil, vt ? ValueType.new(vt.value) : nil, *CoordFrameType.coord_frame_from_xml(root) ) end |
Instance Method Details
#==(f) ⇒ Object
7882 7883 7884 7885 7886 7887 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7882 def ==(f) super(f) and self.reference_position == f.reference_position and self.doppler_definition == f.doppler_definition and self.value_type == f.value_type end |
#to_xml(name = nil) ⇒ Object
7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7889 def to_xml(name=nil) el = super(name) if self.doppler_definition dd = REXML::Element.new("#{obj_ns.prefix}:DopplerDefinition") dd.text = self.doppler_definition.to_s el.add_element(dd) end el.add_element(self.reference_position.to_xml) el.attributes["#{obj_ns.prefix}:value_type"] = self.value_type.to_s if self.value_type collapse_namespaces(el) el end |