Class: FactoryGirl::Attribute::Static
- Inherits:
-
FactoryGirl::Attribute
- Object
- FactoryGirl::Attribute
- FactoryGirl::Attribute::Static
- Defined in:
- lib/factory_girl/attribute/static.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from FactoryGirl::Attribute
Instance Method Summary collapse
- #==(another) ⇒ Object
- #add_to(proxy) ⇒ Object
-
#initialize(name, value, ignored) ⇒ Static
constructor
A new instance of Static.
- #priority ⇒ Object
Methods inherited from FactoryGirl::Attribute
#<=>, #aliases_for?, #association?
Constructor Details
#initialize(name, value, ignored) ⇒ Static
Returns a new instance of Static.
8 9 10 11 |
# File 'lib/factory_girl/attribute/static.rb', line 8 def initialize(name, value, ignored) super(name, ignored) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/factory_girl/attribute/static.rb', line 6 def value @value end |
Instance Method Details
#==(another) ⇒ Object
25 26 27 28 29 |
# File 'lib/factory_girl/attribute/static.rb', line 25 def ==(another) self.name == another.name && self.value == another.value && self.ignored == another.ignored end |
#add_to(proxy) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/factory_girl/attribute/static.rb', line 13 def add_to(proxy) if @ignored proxy.set_ignored(name, @value) else proxy.set(name, @value) end end |
#priority ⇒ Object
21 22 23 |
# File 'lib/factory_girl/attribute/static.rb', line 21 def priority 0 end |