class FactoryBot::NullObject
@api private
Public Class Methods
Source
# File lib/factory_bot/null_object.rb, line 4 def initialize(methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to.map(&:to_s) end
Public Instance Methods
Source
# File lib/factory_bot/null_object.rb, line 8 def method_missing(name, *args, &block) # rubocop:disable Style/MissingRespondToMissing if respond_to?(name) nil else super end end
Calls superclass method
Source
# File lib/factory_bot/null_object.rb, line 16 def respond_to?(method) @methods_to_respond_to.include? method.to_s end