Class: FactoryBot::Syntax::Default::ModifyDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot/syntax/default.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(block) ⇒ Object



56
57
58
# File 'lib/factory_bot/syntax/default.rb', line 56

def self.run(block)
  new.instance_eval(&block)
end

Instance Method Details

#factory(name, _options = {}, &block) ⇒ Object



50
51
52
53
54
# File 'lib/factory_bot/syntax/default.rb', line 50

def factory(name, _options = {}, &block)
  factory = Internal.factory_by_name(name)
  proxy = FactoryBot::DefinitionProxy.new(factory.definition.overridable)
  proxy.instance_eval(&block)
end