Sha256: 6cd6d98c2b8ae850ff2cf969c838d7ea2950d69c85a80dce1014abf8f273f476

Contents?: true

Size: 478 Bytes

Versions: 12

Compression:

Stored size: 478 Bytes

Contents

module FactoryBot
  class Decorator
    class InvocationTracker < Decorator
      def initialize(component)
        super
        @invoked_methods = []
      end

      def method_missing(name, *args, &block) # rubocop:disable Style/MissingRespondToMissing
        @invoked_methods << name
        super
      end
      ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)

      def __invoked_methods__
        @invoked_methods.uniq
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
factory_bot-6.5.0 lib/factory_bot/decorator/invocation_tracker.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/factory_bot-6.4.6/lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.6 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.5 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.4 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.3 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.2 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.1 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.4.0 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.3.0 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.2.1 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-6.2.0 lib/factory_bot/decorator/invocation_tracker.rb