Parent

Methods

FactoryGirl::Callback

Constants

VALID_NAMES

Attributes

block[R]
name[R]

Public Class Methods

new(name, block) click to toggle source
# File lib/factory_girl/callback.rb, line 7
def initialize(name, block)
  @name  = name.to_sym
  @block = block
  check_name
end

Public Instance Methods

==(other) click to toggle source
# File lib/factory_girl/callback.rb, line 21
def ==(other)
  name == other.name &&
    block == other.block
end
run(instance, proxy) click to toggle source
# File lib/factory_girl/callback.rb, line 13
def run(instance, proxy)
  case block.arity
  when 1 then block.call(instance)
  when 2 then block.call(instance, proxy)
  else block.call
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.