Class: VORuby::STC::V1_30::SpectralIntervalType

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

Overview

Contains a 1-D spectral interval.

Instance Attribute Summary collapse

Attributes inherited from CoordScalarIntervalType

#hi_limit, #lo_limit

Attributes inherited from CoordIntervalType

#fill_factor, #frame_id, #hi_include, #lo_include

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CoordScalarIntervalType

coord_scalar_interval_from_xml

Methods inherited from CoordIntervalType

coord_interval_from_xml, #hi_include?, #lo_include?

Methods inherited from STCBaseType

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

#initialize(unit, lo_limit, hi_limit, lo_include = true, hi_include = true, options = {}) ⇒ SpectralIntervalType

Returns a new instance of SpectralIntervalType.



4837
4838
4839
4840
# File 'lib/voruby/stc/1.30/stc.rb', line 4837

def initialize(unit, lo_limit, hi_limit, lo_include=true, hi_include=true, options={})
  self.unit = unit
  super(lo_limit, hi_limit, lo_include, hi_include, options)
end

Instance Attribute Details

#unitObject

Returns the value of attribute unit.



4835
4836
4837
# File 'lib/voruby/stc/1.30/stc.rb', line 4835

def unit
  @unit
end

Class Method Details

.from_xml(xml) ⇒ Object



4861
4862
4863
4864
4865
4866
4867
4868
# File 'lib/voruby/stc/1.30/stc.rb', line 4861

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    SpectralUnitType.new(root.attributes.get_attribute_ns(obj_ns.uri, 'unit').value),
    *CoordScalarIntervalType.coord_scalar_interval_from_xml(root)
  )
end

Instance Method Details

#==(i) ⇒ Object



4851
4852
4853
# File 'lib/voruby/stc/1.30/stc.rb', line 4851

def ==(i)
  super(i) and self.unit == i.unit
end

#to_xml(name = nil) ⇒ Object



4855
4856
4857
4858
4859
# File 'lib/voruby/stc/1.30/stc.rb', line 4855

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