Class: FactoryGirl::NullObject Private
- Inherits:
- BasicObject
- Defined in:
- lib/factory_girl/null_object.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary (collapse)
-
- (NullObject) initialize(methods_to_respond_to)
constructor
private
A new instance of NullObject.
- - (Object) method_missing(name, *args, &block) private
- - (Boolean) respond_to?(method, include_private = false) private
Constructor Details
- (NullObject) initialize(methods_to_respond_to)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A new instance of NullObject
4 5 6 |
# File 'lib/factory_girl/null_object.rb', line 4 def initialize(methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to.map(&:to_s) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(name, *args, &block)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 11 12 13 14 |
# File 'lib/factory_girl/null_object.rb', line 8 def method_missing(name, *args, &block) if respond_to?(name) nil else super end end |
Instance Method Details
- (Boolean) respond_to?(method, include_private = false)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/factory_girl/null_object.rb', line 16 def respond_to?(method, include_private=false) @methods_to_respond_to.include? method.to_s end |