Class: ProconBypassMan::Procon::Macro::NestedStep
- Inherits:
-
BaseNestedStep
- Object
- BaseNestedStep
- ProconBypassMan::Procon::Macro::NestedStep
- Defined in:
- lib/procon_bypass_man/procon/macro.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ NestedStep
constructor
A new instance of NestedStep.
- #next_step ⇒ Object
- #over? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ NestedStep
Returns a new instance of NestedStep.
43 44 45 46 47 48 |
# File 'lib/procon_bypass_man/procon/macro.rb', line 43 def initialize(value) super unless @hash[:end_at] @hash[:end_at] = (Time.now + @hash[:continue_for]).round(4) end end |
Instance Method Details
#next_step ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/procon_bypass_man/procon/macro.rb', line 58 def next_step incr_step_index! if step = current_step return step else reset_step_index! return current_step end end |
#over? ⇒ Boolean
50 51 52 53 54 55 56 |
# File 'lib/procon_bypass_man/procon/macro.rb', line 50 def over? (@hash[:end_at] < Time.now).tap do |result| if result ProconBypassMan.logger.debug { "[Macro] nested step is finished(#{@hash})" } end end end |