Module: Sidekiq::Tasks::Web::Helpers::ApplicationHelper
- Extended by:
- ApplicationHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/sidekiq/tasks/web/helpers/application_helper.rb
Instance Method Summary collapse
- #authorize! ⇒ Object
- #current_env ⇒ Object
- #fetch_param(key) ⇒ Object
- #fetch_params(*keys) ⇒ Object
- #read_view(name) ⇒ Object
Instance Method Details
#authorize! ⇒ Object
28 29 30 31 32 |
# File 'lib/sidekiq/tasks/web/helpers/application_helper.rb', line 28 def return if Sidekiq::Tasks.config..call(env) throw :halt, [403, {"Content-Type" => "text/plain"}, ["Forbidden"]] end |
#current_env ⇒ Object
12 13 14 |
# File 'lib/sidekiq/tasks/web/helpers/application_helper.rb', line 12 def current_env ENV["RAILS_ENV"] || ENV["RACK_ENV"] end |
#fetch_param(key) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/sidekiq/tasks/web/helpers/application_helper.rb', line 16 def fetch_param(key) if Sidekiq::Tasks::Web::SIDEKIQ_GTE_8_0_0 url_params(key.to_s) else params[key.to_s] end end |
#fetch_params(*keys) ⇒ Object
24 25 26 |
# File 'lib/sidekiq/tasks/web/helpers/application_helper.rb', line 24 def fetch_params(*keys) keys.to_h { |key| [key.to_sym, fetch_param(key)] } end |