1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Mimic BasicObject without using BasicObject

This commit is contained in:
Joshua Clayton 2012-01-07 22:52:59 -05:00
parent b734b589f8
commit d9e0372345

View file

@ -1,3 +1,5 @@
require "active_support/basic_object"
module FactoryGirl
class AttributeAssigner
def initialize(build_class, evaluator, attribute_list)
@ -33,7 +35,11 @@ module FactoryGirl
end
def null_object
Class.new(BasicObject) do
Class.new do
instance_methods.each do |m|
undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
end
def method_missing(*args)
nil
end