Class: FactoryBotRails::Reloader

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot_rails/reloader.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, config) ⇒ Reloader

Returns a new instance of Reloader.


7
8
9
10
11
# File 'lib/factory_bot_rails/reloader.rb', line 7

def initialize(app, config)
  @app = app
  @config = config
  @paths = DefinitionFilePaths.new(FactoryBot.definition_file_paths)
end

Instance Method Details

#runObject


13
14
15
16
17
# File 'lib/factory_bot_rails/reloader.rb', line 13

def run
  return unless @paths.any?

  register_reloader(build_reloader)
end