Class: VORuby::STC::V1_10::Coords::ISOTime
- Inherits:
-
Object
- Object
- VORuby::STC::V1_10::Coords::ISOTime
- Includes:
- AbsoluteTime
- Defined in:
- lib/voruby/stc/1.10/coords.rb
Overview
ISO8601 time; note: only a limited subset of ISO 8601 is allowed: yyyy-mm-ddThh:mm:ss.sss…
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dt) ⇒ ISOTime
constructor
A new instance of ISOTime.
- #to_s ⇒ Object
- #to_xml ⇒ Object
Methods included from AbsoluteTime
Methods included from SerializableToXml
Constructor Details
#initialize(dt) ⇒ ISOTime
Returns a new instance of ISOTime.
99 100 101 |
# File 'lib/voruby/stc/1.10/coords.rb', line 99 def initialize(dt) self.value = dt end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
97 98 99 |
# File 'lib/voruby/stc/1.10/coords.rb', line 97 def value @value end |
Class Method Details
.from_xml(xml) ⇒ Object
118 119 120 |
# File 'lib/voruby/stc/1.10/coords.rb', line 118 def self.from_xml(xml) ISOTime.new(element_from(xml).text) end |
Instance Method Details
#to_s ⇒ Object
107 108 109 |
# File 'lib/voruby/stc/1.10/coords.rb', line 107 def to_s self.value.strftime("%FT%T.000") end |
#to_xml ⇒ Object
111 112 113 114 115 116 |
# File 'lib/voruby/stc/1.10/coords.rb', line 111 def to_xml el = element() el.text = self.to_s collapse_namespaces(el) el end |