Class: Sidekiq::Rails::Reloader

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/rails.rb

Instance Method Summary collapse

Constructor Details

#initialize(app = ::Rails.application) ⇒ Reloader

Returns a new instance of Reloader.



9
10
11
# File 'lib/sidekiq/rails.rb', line 9

def initialize(app = ::Rails.application)
  @app = app
end

Instance Method Details

#callObject



13
14
15
16
17
18
# File 'lib/sidekiq/rails.rb', line 13

def call
  params = (::Rails::VERSION::STRING >= "7.1") ? {source: "job.sidekiq"} : {}
  @app.reloader.wrap(**params) do
    yield
  end
end

#inspectObject



20
21
22
# File 'lib/sidekiq/rails.rb', line 20

def inspect
  "#<Sidekiq::Rails::Reloader @app=#{@app.class.name}>"
end

#to_hashObject



24
25
26
# File 'lib/sidekiq/rails.rb', line 24

def to_hash
  {app: @app.class.name}
end