Class: FactoryBot::DefinitionHierarchy

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_from_definition(definition) ⇒ Object


15
16
17
18
19
# File 'lib/factory_bot/definition_hierarchy.rb', line 15

def self.build_from_definition(definition)
  build_to_create(&definition.to_create)
  build_constructor(&definition.constructor)
  add_callbacks definition.callbacks
end

Instance Method Details

#callbacksObject


3
4
5
# File 'lib/factory_bot/definition_hierarchy.rb', line 3

def callbacks
  FactoryBot.callbacks
end

#constructorObject


7
8
9
# File 'lib/factory_bot/definition_hierarchy.rb', line 7

def constructor
  FactoryBot.constructor
end

#to_createObject


11
12
13
# File 'lib/factory_bot/definition_hierarchy.rb', line 11

def to_create
  FactoryBot.to_create
end