Class: VORuby::STC::V1_10::Coords::TimeOrigin

Inherits:
Enumeration
  • Object
show all
Includes:
AbsoluteTime
Defined in:
lib/voruby/stc/1.10/coords.rb

Overview

A relocatable time origin for simulations

Instance Attribute Summary

Attributes inherited from Enumeration

#choices, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AbsoluteTime

#==

Methods included from SerializableToXml

#element

Methods inherited from Enumeration

#==, #to_s

Constructor Details

#initialize(to = 'RELOCATABLE') ⇒ TimeOrigin

Returns a new instance of TimeOrigin.



212
213
214
# File 'lib/voruby/stc/1.10/coords.rb', line 212

def initialize(to='RELOCATABLE')
  self.value = to
end

Class Method Details

.choicesObject



210
# File 'lib/voruby/stc/1.10/coords.rb', line 210

def self.choices; ['RELOCATABLE'] end

.from_xml(xml) ⇒ Object



223
224
225
# File 'lib/voruby/stc/1.10/coords.rb', line 223

def self.from_xml(xml)
  TimeOrigin.new(element_from(xml).text)
end

Instance Method Details

#to_xmlObject



216
217
218
219
220
221
# File 'lib/voruby/stc/1.10/coords.rb', line 216

def to_xml
  el = element()
  el.text = self.value.to_s
  collapse_namespaces(el)
  el
end