# File lib/factory_girl/callback.rb, line 5 def initialize(name, block) @name = name.to_sym @block = block ensure_valid_callback_name! end
# File lib/factory_girl/callback.rb, line 19 def ==(other) name == other.name && block == other.block end
# File lib/factory_girl/callback.rb, line 11 def run(instance, evaluator) case block.arity when 1 then syntax_runner.instance_exec(instance, &block) when 2 then syntax_runner.instance_exec(instance, evaluator, &block) else syntax_runner.instance_exec(&block) end end