Class: Scenarios::Scenario

Inherits:
Object
  • Object
show all
Defined in:
lib/scenarios/scenario.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Scenario

Initialize the new instance using the block

Parameters:

  • name (String, Symbol)
  • block (Proc)


13
14
15
16
# File 'lib/scenarios/scenario.rb', line 13

def initialize(name, &block)
  @name = name
  @block = block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/scenarios/scenario.rb', line 5

def name
  @name
end

Instance Method Details

#generateObject

Run the initialization block

Parameters:



23
24
25
# File 'lib/scenarios/scenario.rb', line 23

def generate
  @block.bind(self).call if @block.is_a?(Proc)
end