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.
5 6 7 |
# File 'lib/cucumber/glue/world_factory.rb', line 5 def initialize(proc) @proc = proc || -> { Object.new } end |
Instance Method Details
#create_world ⇒ Object
9 10 11 |
# File 'lib/cucumber/glue/world_factory.rb', line 9 def create_world @proc.call || raise_nil_world end |
#raise_nil_world ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/cucumber/glue/world_factory.rb', line 13 def raise_nil_world raise NilWorld.new rescue NilWorld => e e.backtrace.clear e.backtrace.push(Glue.backtrace_line(@proc, 'World')) raise e end |