Class: FactoryGirl::DefinitionHierarchy

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_girl/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_girl/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_girl/definition_hierarchy.rb', line 3

def callbacks
  FactoryGirl.callbacks
end

#constructorObject



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

def constructor
  FactoryGirl.constructor
end

#to_createObject



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

def to_create
  FactoryGirl.to_create
end