Class: ManageIQ::Floe::Workflow::States::Wait

Inherits:
ManageIQ::Floe::Workflow::State show all
Defined in:
lib/manageiq/floe/workflow/states/wait.rb

Instance Attribute Summary collapse

Attributes inherited from ManageIQ::Floe::Workflow::State

#comment, #name, #payload, #type, #workflow

Instance Method Summary collapse

Methods inherited from ManageIQ::Floe::Workflow::State

build!, #context, #end?, #to_dot, #to_dot_transitions

Methods included from Logging

included, #logger

Constructor Details

#initialize(workflow, name, payload) ⇒ Wait

Returns a new instance of Wait.



10
11
12
13
14
15
16
17
18
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 10

def initialize(workflow, name, payload)
  super

  @next    = payload["Next"]
  @seconds = payload["Seconds"].to_i

  @input_path  = Path.new(payload.fetch("InputPath", "$"), context)
  @output_path = Path.new(payload.fetch("OutputPath", "$"), context)
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



8
9
10
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 8

def end
  @end
end

#input_pathObject (readonly)

Returns the value of attribute input_path.



8
9
10
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 8

def input_path
  @input_path
end

#nextObject (readonly)

Returns the value of attribute next.



8
9
10
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 8

def next
  @next
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



8
9
10
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 8

def output_path
  @output_path
end

#secondsObject (readonly)

Returns the value of attribute seconds.



8
9
10
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 8

def seconds
  @seconds
end

Instance Method Details

#run!Object



20
21
22
# File 'lib/manageiq/floe/workflow/states/wait.rb', line 20

def run!(*)
  super { sleep(seconds); nil }
end