Class: Factory::Attribute::Callback

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Factory::Attribute

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, block) ⇒ Callback

Returns a new instance of Callback.



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

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

Instance Method Details

#add_to(proxy) ⇒ Object



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

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