Class: FactoryGirl::DefinitionList
- Inherits:
-
Object
- Object
- FactoryGirl::DefinitionList
- Includes:
- Enumerable
- Defined in:
- lib/factory_girl/definition_list.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #callbacks ⇒ Object
- #constructor ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(definitions = []) ⇒ DefinitionList
constructor
A new instance of DefinitionList.
- #to_create ⇒ Object
Constructor Details
#initialize(definitions = []) ⇒ DefinitionList
Returns a new instance of DefinitionList.
5 6 7 |
# File 'lib/factory_girl/definition_list.rb', line 5 def initialize(definitions = []) @definitions = definitions end |
Instance Method Details
#attributes ⇒ Object
17 18 19 |
# File 'lib/factory_girl/definition_list.rb', line 17 def attributes map {|definition| definition.attributes.to_a }.flatten end |
#callbacks ⇒ Object
13 14 15 |
# File 'lib/factory_girl/definition_list.rb', line 13 def callbacks map(&:callbacks).flatten end |
#constructor ⇒ Object
25 26 27 |
# File 'lib/factory_girl/definition_list.rb', line 25 def constructor map(&:constructor).compact.last end |
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/factory_girl/definition_list.rb', line 9 def each(&block) @definitions.each &block end |
#to_create ⇒ Object
21 22 23 |
# File 'lib/factory_girl/definition_list.rb', line 21 def to_create map(&:to_create).compact.last end |