Module: FactoryBot::Sorbet::Internal

Included in:
FactoryBot
Defined in:
lib/factory_bot/sorbet/override.rb

Overview

@requires_ancestor: singleton(::FactoryBot::Internal)

Instance Method Summary collapse

Instance Method Details

#register_factory(factory) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/factory_bot/sorbet/override.rb', line 8

def register_factory(factory)
  factory.names.each do |name|
    Sorbet.module_eval "      def \#{name}(kind, *args, **kwargs, &block)\n        ::FactoryBot.public_send(kind, \#{name.inspect}, *args, **kwargs, &block)\n      end\n    RUBY\n  end\n\n  super\nend\n", __FILE__, __LINE__ + 1