Class: VORuby::STC::V1_10::Coords::JDTime
- Inherits:
-
Object
- Object
- VORuby::STC::V1_10::Coords::JDTime
- Includes:
- AbsoluteTime
- Defined in:
- lib/voruby/stc/1.10/coords.rb
Overview
JD time
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dt) ⇒ JDTime
constructor
A new instance of JDTime.
- #to_datetime ⇒ Object
- #to_s ⇒ Object
- #to_xml ⇒ Object
Methods included from AbsoluteTime
Methods included from SerializableToXml
Constructor Details
#initialize(dt) ⇒ JDTime
Returns a new instance of JDTime.
134 135 136 |
# File 'lib/voruby/stc/1.10/coords.rb', line 134 def initialize(dt) self.value = dt end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
132 133 134 |
# File 'lib/voruby/stc/1.10/coords.rb', line 132 def value @value end |
Class Method Details
.from_xml(xml) ⇒ Object
157 158 159 |
# File 'lib/voruby/stc/1.10/coords.rb', line 157 def self.from_xml(xml) JDTime.new(element_from(xml).text) end |
Instance Method Details
#to_datetime ⇒ Object
146 147 148 |
# File 'lib/voruby/stc/1.10/coords.rb', line 146 def to_datetime DateTime.jd(self.value) end |
#to_s ⇒ Object
142 143 144 |
# File 'lib/voruby/stc/1.10/coords.rb', line 142 def to_s self.value.to_s end |
#to_xml ⇒ Object
150 151 152 153 154 155 |
# File 'lib/voruby/stc/1.10/coords.rb', line 150 def to_xml el = element() el.text = self.value.to_s collapse_namespaces(el) el end |