Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/when_exe/core/duration.rb,
lib/when_exe/core/extension.rb
Overview
Extensions to Array class
Instance Method Summary collapse
-
#duration ⇒ When::TM::Duration
(also: #to_duration)
self を Array<日, 時, 分, 秒> とみなして When::TM::Duration を生成.
-
#tm_pos(options = {}) ⇒ When::TM::TemporalPosition
(also: #to_tm_pos)
self を暦要素の Array とみなして [When::TM::TemporalPosition] を生成.
-
#to_pair ⇒ When::Coordinates::Pair
(also: #pair)
self をと解釈してWhen::Coordinates::Pair を生成.
Instance Method Details
#duration ⇒ When::TM::Duration Also known as: to_duration
Note:
core/duration
self を Array<日, 時, 分, 秒> とみなして When::TM::Duration を生成
143 144 145 |
# File 'lib/when_exe/core/duration.rb', line 143 def duration When::TM::Duration.dhms(*self) end |
#tm_pos(options = {}) ⇒ When::TM::TemporalPosition Also known as: to_tm_pos
Note:
core/extension
self を暦要素の Array とみなして [When::TM::TemporalPosition] を生成
464 465 466 |
# File 'lib/when_exe/core/extension.rb', line 464 def tm_pos(={}) When.TemporalPosition(*(self.dup << )) end |
#to_pair ⇒ When::Coordinates::Pair Also known as: pair
self をと解釈してWhen::Coordinates::Pair を生成
475 476 477 |
# File 'lib/when_exe/core/extension.rb', line 475 def to_pair Coordinates::Pair._force_pair(*self) end |