Class: FactoryGirl::AttributeList Private
- Inherits:
-
Object
- Object
- FactoryGirl::AttributeList
- Includes:
- Enumerable
- Defined in:
- lib/factory_girl/attribute_list.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary (collapse)
- - (Object) apply_attributes(attributes_to_apply) private
- - (Object) associations private
- - (Object) define_attribute(attribute) private
- - (Object) each(&block) private
- - (Object) ignored private
-
- (AttributeList) initialize(name = nil, attributes = [])
constructor
private
A new instance of AttributeList.
- - (Object) names private
- - (Object) non_ignored private
Constructor Details
- (AttributeList) initialize(name = nil, attributes = [])
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A new instance of AttributeList
6 7 8 9 |
# File 'lib/factory_girl/attribute_list.rb', line 6 def initialize(name = nil, attributes = []) @name = name @attributes = attributes end |
Instance Method Details
- (Object) apply_attributes(attributes_to_apply)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/factory_girl/attribute_list.rb', line 38 def apply_attributes(attributes_to_apply) attributes_to_apply.each {|attribute| add_attribute(attribute) } end |
- (Object) associations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/factory_girl/attribute_list.rb', line 26 def associations AttributeList.new(@name, select(&:association?)) end |
- (Object) define_attribute(attribute)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 |
# File 'lib/factory_girl/attribute_list.rb', line 11 def define_attribute(attribute) ensure_attribute_not_self_referencing! attribute ensure_attribute_not_defined! attribute add_attribute attribute end |
- (Object) each(&block)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/factory_girl/attribute_list.rb', line 18 def each(&block) @attributes.each(&block) end |
- (Object) ignored
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/factory_girl/attribute_list.rb', line 30 def ignored AttributeList.new(@name, select(&:ignored)) end |
- (Object) names
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/factory_girl/attribute_list.rb', line 22 def names map(&:name) end |
- (Object) non_ignored
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/factory_girl/attribute_list.rb', line 34 def non_ignored AttributeList.new(@name, reject(&:ignored)) end |