Class: ProconBypassMan::Procon::Macro::NestedStep

Inherits:
BaseNestedStep show all
Defined in:
lib/procon_bypass_man/procon/macro.rb

Instance Method Summary collapse

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_stepObject



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

Returns:

  • (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