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, #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


9
10
11
12
# File 'lib/factory_bot/decorator/invocation_tracker.rb', line 9

def method_missing(name, *args, &block)
  @invoked_methods << name
  super
end

Instance Method Details

#__invoked_methods__Object


14
15
16
# File 'lib/factory_bot/decorator/invocation_tracker.rb', line 14

def __invoked_methods__
  @invoked_methods.uniq
end