Class: Factory::Attribute
- Inherits:
-
Object
- Object
- Factory::Attribute
- Defined in:
- lib/factory_girl/attribute.rb,
lib/factory_girl/attribute/static.rb,
lib/factory_girl/attribute/dynamic.rb,
lib/factory_girl/attribute/callback.rb,
lib/factory_girl/attribute/association.rb
Overview
:nodoc:
Direct Known Subclasses
Defined Under Namespace
Classes: Association, Callback, Dynamic, Static
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_to(proxy) ⇒ Object
-
#initialize(name) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name) ⇒ Attribute
Returns a new instance of Attribute.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/factory_girl/attribute.rb', line 14 def initialize(name) @name = name.to_sym if @name.to_s =~ /=$/ attribute_name = $` raise AttributeDefinitionError, "factory_girl uses 'f.#{attribute_name} value' syntax " + "rather than 'f.#{attribute_name} = value'" end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/factory_girl/attribute.rb', line 12 def name @name end |
Instance Method Details
#add_to(proxy) ⇒ Object
25 26 |
# File 'lib/factory_girl/attribute.rb', line 25 def add_to(proxy) end |