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_pos(options = {}) ⇒ When::TM::DateAndTime
(also: #to_tm_pos)
対応する When::TM::DateAndTime を生成.
Instance Method Details
#+(other) ⇒ Object
63 64 65 |
# File 'lib/when_exe/core/duration.rb', line 63 def +(other) other.kind_of?(When::TM::Duration) ? self + other.to_f : self._plus_(other) end |
#-(other) ⇒ Object
69 70 71 |
# File 'lib/when_exe/core/duration.rb', line 69 def -(other) other.kind_of?(When::TM::Duration) ? self - other.to_f : self._minus_(other) end |
#_minus_ ⇒ Object
68 |
# File 'lib/when_exe/core/duration.rb', line 68 alias :_minus_ :- |
#_plus_ ⇒ Object
62 |
# File 'lib/when_exe/core/duration.rb', line 62 alias :_plus_ :+ |
#julian_date(options = {}) ⇒ When::TM::JulianDate Also known as: to_julian_date
Note:
core/extension
対応する When::TM::JulianDate を生成
29 30 31 32 |
# File 'lib/when_exe/core/extension.rb', line 29 def julian_date(={}) [:clock] ||= Clock(self.utc_offset) When::TM::JulianDate.universal_time(self.to_f * When::TM::IntervalLength::SECOND, ) end |
#tm_pos(options = {}) ⇒ When::TM::DateAndTime Also known as: to_tm_pos
Note:
core/extension
対応する When::TM::DateAndTime を生成
46 47 48 |
# File 'lib/when_exe/core/extension.rb', line 46 def tm_pos(={}) When.at(self, ) end |