Class: FactoryGirl::Trait Private
- Inherits:
-
Object
- Object
- FactoryGirl::Trait
- Defined in:
- lib/factory_girl/trait.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 Attribute Summary (collapse)
- - (Object) definition readonly private
- - (Object) name readonly private
Instance Method Summary (collapse)
- - (Object) ==(other) private
-
- (Trait) initialize(name, &block)
constructor
private
A new instance of Trait.
- - (Object) names private
Constructor Details
- (Trait) initialize(name, &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.
A new instance of Trait
6 7 8 9 10 11 12 13 |
# File 'lib/factory_girl/trait.rb', line 6 def initialize(name, &block) @name = name @block = block @definition = Definition.new(@name) proxy = FactoryGirl::DefinitionProxy.new(@definition) proxy.instance_eval(&@block) if block_given? end |
Instance Attribute Details
- (Object) definition (readonly)
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.
4 5 6 |
# File 'lib/factory_girl/trait.rb', line 4 def definition @definition end |
- (Object) name (readonly)
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.
4 5 6 |
# File 'lib/factory_girl/trait.rb', line 4 def name @name end |
Instance Method Details
- (Object) ==(other)
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 25 |
# File 'lib/factory_girl/trait.rb', line 22 def ==(other) name == other.name && block == other.block 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.
18 19 20 |
# File 'lib/factory_girl/trait.rb', line 18 def names [@name] end |