Class: FactoryGirl::Attribute::Static

Inherits:
FactoryGirl::Attribute show all
Defined in:
lib/factory_girl/attribute/static.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from FactoryGirl::Attribute

#ignored, #name

Instance Method Summary collapse

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

#valueObject (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

#priorityObject



21
22
23
# File 'lib/factory_girl/attribute/static.rb', line 21

def priority
  0
end