Class: Stringup::Script::Builder

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

Instance Method Summary collapse

Constructor Details

#initialize(script, &block) ⇒ Builder

Returns a new instance of Builder.



36
37
38
39
# File 'lib/stringup/script.rb', line 36

def initialize(script, &block)
  @script = script
  instance_eval(&block) if block_given?
end

Instance Method Details

#command(line) ⇒ Object



45
46
47
# File 'lib/stringup/script.rb', line 45

def command(line)
  @script.command = line
end

#scenario(name, description = name.to_s, &block) ⇒ Object



41
42
43
44
# File 'lib/stringup/script.rb', line 41

def scenario(name, description = name.to_s, &block)
  scenario = ::Stringup::Scenario.new(name, description, &block)
  @script << scenario
end