Class: Script::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/script/step.rb

Instance Method Summary collapse

Constructor Details

#initialize(headline, block) ⇒ Step

Returns a new instance of Step.



2
3
4
5
# File 'lib/script/step.rb', line 2

def initialize(headline, block)
  @headline = headline
  @block = block
end

Instance Method Details

#headlineObject



18
19
20
# File 'lib/script/step.rb', line 18

def headline
  @headline
end

#resultObject



14
15
16
# File 'lib/script/step.rb', line 14

def result
  @result
end

#runObject



7
8
9
10
11
12
# File 'lib/script/step.rb', line 7

def run
  @block.call
  @result = :succeded
rescue
  @result = :failed
end