Class: FactoryBot::Decorator::InvocationTracker

Inherits:
FactoryBot::Decorator show all
Defined in:
lib/factory_bot/decorator/invocation_tracker.rb

Instance Method Summary collapse

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