Class: Sidekiq::WebActionHelper::ERB
- Inherits:
-
ERB
- Object
- ERB
- Sidekiq::WebActionHelper::ERB
- Defined in:
- lib/sidekiq/web_action_helper.rb
Class Attribute Summary collapse
-
.sidekiq_path_info ⇒ Object
Returns the value of attribute sidekiq_path_info.
-
.sidekiq_request_method ⇒ Object
Returns the value of attribute sidekiq_request_method.
Instance Method Summary collapse
-
#initialize(content) ⇒ ERB
constructor
A new instance of ERB.
Constructor Details
#initialize(content) ⇒ ERB
Returns a new instance of ERB.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sidekiq/web_action_helper.rb', line 9 def initialize(content) replace_views = Sidekiq::Config::DEFAULTS[:replace_views] || {} replace_views.each do |key, content_blocks| router = Sidekiq::Web::Route.new(self.class.sidekiq_request_method, key, true) next if router.match(self.class.sidekiq_request_method, self.class.sidekiq_path_info).nil? content_blocks.each do |content_block| content_block.call(content) end end super end |
Class Attribute Details
.sidekiq_path_info ⇒ Object
Returns the value of attribute sidekiq_path_info.
26 27 28 |
# File 'lib/sidekiq/web_action_helper.rb', line 26 def sidekiq_path_info @sidekiq_path_info end |
.sidekiq_request_method ⇒ Object
Returns the value of attribute sidekiq_request_method.
26 27 28 |
# File 'lib/sidekiq/web_action_helper.rb', line 26 def sidekiq_request_method @sidekiq_request_method end |