Class: Scenarios::Scenario
- Inherits:
-
Object
- Object
- Scenarios::Scenario
- Defined in:
- lib/scenarios/scenario.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#generate ⇒ Object
Run the initialization block.
-
#initialize(name, &block) ⇒ Scenario
constructor
Initialize the new instance using the block.
Constructor Details
#initialize(name, &block) ⇒ Scenario
Initialize the new instance using the block
13 14 15 16 |
# File 'lib/scenarios/scenario.rb', line 13 def initialize(name, &block) @name = name @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/scenarios/scenario.rb', line 5 def name @name end |
Instance Method Details
#generate ⇒ Object
Run the initialization block
23 24 25 |
# File 'lib/scenarios/scenario.rb', line 23 def generate @block.bind(self).call if @block.is_a?(Proc) end |