Class: FactoryGirl::Declaration

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_girl/declaration.rb,
lib/factory_girl/declaration/static.rb,
lib/factory_girl/declaration/dynamic.rb,
lib/factory_girl/declaration/implicit.rb,
lib/factory_girl/declaration/association.rb

Direct Known Subclasses

Association, Dynamic, Implicit, Static

Defined Under Namespace

Classes: Association, Dynamic, Implicit, Static

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, ignored = false) ⇒ Declaration

Returns a new instance of Declaration.



10
11
12
13
# File 'lib/factory_girl/declaration.rb', line 10

def initialize(name, ignored = false)
  @name    = name
  @ignored = ignored
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/factory_girl/declaration.rb', line 8

def name
  @name
end

Instance Method Details

#ignoreObject



15
16
17
18
# File 'lib/factory_girl/declaration.rb', line 15

def ignore
  $stderr.puts "DEPRECATION WARNING: Use ignore block syntax instead of calling #ignore"
  @ignored = true
end

#to_attributesObject



20
21
22
# File 'lib/factory_girl/declaration.rb', line 20

def to_attributes
  build
end