Class: VORuby::STC::V1_30::Vel2VecIntervalType

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

Overview

2-D coordinate interval type.

Direct Known Subclasses

Velocity2VecInterval

Instance Attribute Summary collapse

Attributes inherited from VelocityIntervalType

#vel_time_unit

Attributes inherited from SpatialIntervalType

#epoch, #unit

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 VelocityIntervalType

velocity_interval_from_xml

Methods inherited from SpatialIntervalType

spatial_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(lo_limit, hi_limit, vel_time_unit, lo_include = true, hi_include = true, options = {}) ⇒ Vel2VecIntervalType

Returns a new instance of Vel2VecIntervalType.



4462
4463
4464
4465
4466
# File 'lib/voruby/stc/1.30/stc.rb', line 4462

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

Instance Attribute Details

#hi_limitObject

Returns the value of attribute hi_limit.



4460
4461
4462
# File 'lib/voruby/stc/1.30/stc.rb', line 4460

def hi_limit
  @hi_limit
end

#lo_limitObject

Returns the value of attribute lo_limit.



4460
4461
4462
# File 'lib/voruby/stc/1.30/stc.rb', line 4460

def lo_limit
  @lo_limit
end

Class Method Details

.from_xml(xml) ⇒ Object



4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
# File 'lib/voruby/stc/1.30/stc.rb', line 4496

def self.from_xml(xml)
  root = element_from(xml)
  
  lo_limit = REXML::XPath.first(root, 'x:LoLimit2Vec', {'x' => obj_ns.uri})
  hi_limit = REXML::XPath.first(root, 'x:HiLimit2Vec', {'x' => obj_ns.uri})
  
  self.new(
    lo_limit ? Double2Type.from_xml(lo_limit) : nil,
    hi_limit ? Double2Type.from_xml(hi_limit) : nil,
    *VelocityIntervalType.velocity_interval_from_xml(root)
  )
end

Instance Method Details

#==(i) ⇒ Object



4480
4481
4482
4483
4484
# File 'lib/voruby/stc/1.30/stc.rb', line 4480

def ==(i)
  super(i) and
  self.lo_limit == i.lo_limit and
  self.hi_limit == i.hi_limit
end

#to_xml(name = nil) ⇒ Object



4486
4487
4488
4489
4490
4491
4492
4493
4494
# File 'lib/voruby/stc/1.30/stc.rb', line 4486

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.lo_limit.to_xml('LoLimit2Vec')) if self.lo_limit
  el.add_element(self.hi_limit.to_xml('HiLimit2Vec')) if self.hi_limit
  
  collapse_namespaces(el)
  el
end