Class: VORuby::STC::V1_30::SpectralCoordinateType

Inherits:
BasicCoordinateType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Spectral coordinate type.

Direct Known Subclasses

Spectral

Instance Attribute Summary collapse

Attributes inherited from BasicCoordinateType

#error, #pix_size, #resolution, #size, #value

Attributes inherited from CoordinateType

#frame_id, #name

Attributes included from STCReference

#id, #idref, #ucd, #xlink_href, #xlink_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasicCoordinateType

basic_coordinate_from_xml

Methods inherited from CoordinateType

coordinate_from_xml

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

#element

Constructor Details

This class inherits a constructor from VORuby::STC::V1_30::STCBaseType

Instance Attribute Details

#coord_system_idObject

Returns the value of attribute coord_system_id.



2846
2847
2848
# File 'lib/voruby/stc/1.30/stc.rb', line 2846

def coord_system_id
  @coord_system_id
end

#unitObject

Returns the value of attribute unit.



2846
2847
2848
# File 'lib/voruby/stc/1.30/stc.rb', line 2846

def unit
  @unit
end

Class Method Details

.from_xml(xml) ⇒ Object



2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
# File 'lib/voruby/stc/1.30/stc.rb', line 2879

def self.from_xml(xml)
  root = element_from(xml)
  
  options = BasicCoordinateType.basic_coordinate_from_xml(root)
  
  csi = root.attributes.get_attribute_ns(obj_ns.uri, 'coord_system_id')
  options[:coord_system_id] = IdRef.new(csi.value) if csi
  
  unit = root.attributes.get_attribute_ns(obj_ns.uri, 'unit')
  options[:unit] = SpectralUnitType.new(unit.value) if unit
  
  self.new(options)
end

Instance Method Details

#==(c) ⇒ Object



2864
2865
2866
2867
2868
# File 'lib/voruby/stc/1.30/stc.rb', line 2864

def ==(c)
  super(c) and
  self.coord_system_id == c.coord_system_id and
  self.unit == c.unit
end

#to_xml(name = nil) ⇒ Object



2870
2871
2872
2873
2874
2875
2876
2877
# File 'lib/voruby/stc/1.30/stc.rb', line 2870

def to_xml(name=nil)
  el = super(name)
  
  el.attributes["#{obj_ns.prefix}:coord_system_id"] = self.coord_system_id.to_s if self.coord_system_id
  el.attributes["#{obj_ns.prefix}:unit"] = self.unit.to_s if self.unit
  
  el
end