Class: Cucumber::Glue::WorldFactory
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/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.
4 5 6 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/glue/world_factory.rb', line 4 def initialize(proc) @proc = proc || -> { Object.new } end |
Instance Method Details
#create_world ⇒ Object
8 9 10 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/glue/world_factory.rb', line 8 def create_world @proc.call || raise_nil_world end |
#raise_nil_world ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/glue/world_factory.rb', line 12 def raise_nil_world raise NilWorld rescue NilWorld => e e.backtrace.clear e.backtrace.push(Glue.backtrace_line(@proc, 'World')) raise e end |