Class: Henk::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/henk/sequence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(henk) ⇒ Sequence

Returns a new instance of Sequence.



7
8
9
# File 'lib/henk/sequence.rb', line 7

def initialize(henk)
  @henk = henk
end

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



5
6
7
# File 'lib/henk/sequence.rb', line 5

def image
  @image
end

Instance Method Details

#after_wait(&block) ⇒ Object

called with container id (string) and exit code (numeric)



12
13
14
# File 'lib/henk/sequence.rb', line 12

def after_wait(&block)
  @after_wait_block = block
end

#on_bad_exit(&block) ⇒ Object

called with container id (string) and exit code (numeric)



17
18
19
# File 'lib/henk/sequence.rb', line 17

def on_bad_exit(&block)
  @bad_exit_block = block
end

#step(*args) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/henk/sequence.rb', line 21

def step(*args)
  result = Step.new(@henk, *args)
  result.after_wait(&@after_wait_block) if @after_wait_block
  result.on_bad_exit(&@bad_exit_block) if @bad_exit_block
  result.perform!
  @image = result.image
  result
end