Class: FactoryGirl::Attribute::Callback

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from FactoryGirl::Attribute

#ignored, #name

Instance Method Summary collapse

Methods inherited from FactoryGirl::Attribute

#<=>, #aliases_for?, #association?, #ignore, #priority

Constructor Details

#initialize(name, block) ⇒ Callback

Returns a new instance of Callback.



4
5
6
7
# File 'lib/factory_girl/attribute/callback.rb', line 4

def initialize(name, block)
  @name  = name.to_sym
  @block = block
end

Instance Method Details

#add_to(proxy) ⇒ Object



9
10
11
# File 'lib/factory_girl/attribute/callback.rb', line 9

def add_to(proxy)
  proxy.add_callback(name, @block)
end