Class: Chrono::NextTime
- Inherits:
-
Object
- Object
- Chrono::NextTime
- Defined in:
- lib/chrono/next_time.rb
Instance Attribute Summary collapse
-
#now ⇒ Object
readonly
Returns the value of attribute now.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#time ⇒ Object
writeonly
Sets the attribute time.
Instance Method Summary collapse
-
#initialize(options) ⇒ NextTime
constructor
A new instance of NextTime.
- #to_time ⇒ Object
Constructor Details
#initialize(options) ⇒ NextTime
Returns a new instance of NextTime.
11 12 13 14 |
# File 'lib/chrono/next_time.rb', line 11 def initialize() @now = [:now] @source = [:source] end |
Instance Attribute Details
#now ⇒ Object (readonly)
Returns the value of attribute now.
7 8 9 |
# File 'lib/chrono/next_time.rb', line 7 def now @now end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/chrono/next_time.rb', line 7 def source @source end |
#time=(value) ⇒ Object
Sets the attribute time
9 10 11 |
# File 'lib/chrono/next_time.rb', line 9 def time=(value) @time = value end |
Instance Method Details
#to_time ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/chrono/next_time.rb', line 16 def to_time loop do case when !scheduled_in_this_month? carry_month when !scheduled_in_this_day? carry_day when !scheduled_in_this_wday? carry_day when !scheduled_in_this_hour? carry_hour when !scheduled_in_this_minute? carry_minute else break time end end end |