Class: Kuroko2::Workflow::Task::Sleep

Inherits:
Base
  • Object
show all
Defined in:
lib/autoload/kuroko2/workflow/task/sleep.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Kuroko2::Workflow::Task::Base

Instance Method Details

#executeObject



5
6
7
8
9
# File 'lib/autoload/kuroko2/workflow/task/sleep.rb', line 5

def execute
  token.context['SLEEP'] = Time.current.to_i + option.to_i

  :next
end

#validateObject



11
12
13
14
15
# File 'lib/autoload/kuroko2/workflow/task/sleep.rb', line 11

def validate
  unless /^\d+$/ === option
    raise Workflow::AssertionError, "A value of sleep should be a number."
  end
end