Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/when_exe/core/duration.rb,
lib/when_exe/core/extension.rb,
lib/when_exe/mini_application.rb
Overview
Time for v1.8.x compatibility
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #_minus_ ⇒ Object
- #_plus_ ⇒ Object
-
#julian_date(options = {}) ⇒ When::TM::JulianDate
(also: #to_julian_date)
対応する When::TM::JulianDate を生成.
-
#tm_position(options = {}) ⇒ When::TM::DateAndTime
(also: #to_tm_position)
対応する When::TM::DateAndTime を生成.
Instance Method Details
#+(other) ⇒ Object
19 20 21 |
# File 'lib/when_exe/core/duration.rb', line 19 def +(other) other.kind_of?(When::TM::Duration) ? self + other.to_f : self._plus_(other) end |
#-(other) ⇒ Object
25 26 27 |
# File 'lib/when_exe/core/duration.rb', line 25 def -(other) other.kind_of?(When::TM::Duration) ? self - other.to_f : self._minus_(other) end |
#_minus_ ⇒ Object
24 |
# File 'lib/when_exe/core/duration.rb', line 24 alias :_minus_ :- |
#_plus_ ⇒ Object
18 |
# File 'lib/when_exe/core/duration.rb', line 18 alias :_plus_ :+ |
#julian_date(options = {}) ⇒ When::TM::JulianDate Also known as: to_julian_date
Note:
core/extension
対応する When::TM::JulianDate を生成
29 30 31 |
# File 'lib/when_exe/core/extension.rb', line 29 def julian_date(={}) When::TM::JulianDate.universal_time(self.to_f * When::TM::IntervalLength::SECOND, ) end |
#tm_position(options = {}) ⇒ When::TM::DateAndTime Also known as: to_tm_position
Note:
core/extension
対応する When::TM::DateAndTime を生成
45 46 47 |
# File 'lib/when_exe/core/extension.rb', line 45 def tm_position(={}) When.at(self, ) end |