Module: Sidekiq::Throttled::Web::SummaryFix
- Defined in:
- lib/sidekiq/throttled/web/summary_fix.rb
Constant Summary collapse
- JAVASCRIPT =
[File.read(__FILE__.sub(/\.rb$/, ".js")).freeze].freeze
- HEADERS =
{ "Content-Type" => "application/javascript" }.freeze
Class Attribute Summary collapse
-
.enabled ⇒ Object
Returns the value of attribute enabled.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.enabled ⇒ Object
Returns the value of attribute enabled.
11 12 13 |
# File 'lib/sidekiq/throttled/web/summary_fix.rb', line 11 def enabled @enabled end |
Class Method Details
.apply!(app) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/sidekiq/throttled/web/summary_fix.rb', line 13 def apply!(app) Sidekiq::WebAction.send(:prepend, SummaryFix) app.get("/throttled/summary_fix") do [200, HEADERS.dup, JAVASCRIPT.dup] end end |
Instance Method Details
#display_custom_head ⇒ Object
21 22 23 |
# File 'lib/sidekiq/throttled/web/summary_fix.rb', line 21 def display_custom_head "#{super}#{summary_fix_script if SummaryFix.enabled}" end |