Class: Cucumber::Glue::WorldFactory
- Inherits:
-
Object
- Object
- Cucumber::Glue::WorldFactory
- Defined in:
- lib/cucumber/glue/world_factory.rb
Instance Method Summary collapse
- #create_world ⇒ Object
-
#initialize(proc) ⇒ WorldFactory
constructor
A new instance of WorldFactory.
- #raise_nil_world ⇒ Object
Constructor Details
#initialize(proc) ⇒ WorldFactory
Returns a new instance of WorldFactory.
6 7 8 |
# File 'lib/cucumber/glue/world_factory.rb', line 6 def initialize(proc) @proc = proc || -> { Object.new } end |
Instance Method Details
#create_world ⇒ Object
10 11 12 |
# File 'lib/cucumber/glue/world_factory.rb', line 10 def create_world @proc.call || raise_nil_world end |
#raise_nil_world ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cucumber/glue/world_factory.rb', line 14 def raise_nil_world raise NilWorld rescue NilWorld => e e.backtrace.clear e.backtrace.push(Glue.backtrace_line(@proc, 'World')) raise e end |