Class: FactoryBot::Decorator::InvocationTracker
- Inherits:
-
FactoryBot::Decorator
- Object
- FactoryBot::Decorator
- FactoryBot::Decorator::InvocationTracker
- Defined in:
- lib/factory_bot/decorator/invocation_tracker.rb
Instance Method Summary collapse
- #__invoked_methods__ ⇒ Object
-
#initialize(component) ⇒ InvocationTracker
constructor
A new instance of InvocationTracker.
-
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MissingRespondToMissing.
Methods inherited from FactoryBot::Decorator
const_missing, #respond_to_missing?, #send
Constructor Details
#initialize(component) ⇒ InvocationTracker
Returns a new instance of InvocationTracker.
4 5 6 7 |
# File 'lib/factory_bot/decorator/invocation_tracker.rb', line 4 def initialize(component) super @invoked_methods = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MissingRespondToMissing
9 10 11 12 |
# File 'lib/factory_bot/decorator/invocation_tracker.rb', line 9 def method_missing(name, *args, &block) # rubocop:disable Style/MissingRespondToMissing @invoked_methods << name super end |
Instance Method Details
#__invoked_methods__ ⇒ Object
15 16 17 |
# File 'lib/factory_bot/decorator/invocation_tracker.rb', line 15 def __invoked_methods__ @invoked_methods.uniq end |