Class: BatchApi::Operation::Rails

Inherits:
Rack
  • Object
show all
Defined in:
lib/batch_api/operation/rails.rb

Instance Attribute Summary

Attributes inherited from Rack

#app, #env, #headers, #method, #params, #result, #url

Instance Method Summary collapse

Methods inherited from Rack

#execute

Constructor Details

#initialize(op, base_env, app) ⇒ Rails

Public: create a new Rails Operation. It does all that Rack does and also some additional Rails-specific processing.



9
10
11
12
# File 'lib/batch_api/operation/rails.rb', line 9

def initialize(op, base_env, app)
  super
  @params = params_with_path_components
end

Instance Method Details

#process_envObject

Internal: customize the request environment. This is currently done manually and feels clunky and brittle, but is mostly likely fine, though there are one or two environment parameters not yet adjusted.



17
18
19
20
21
22
# File 'lib/batch_api/operation/rails.rb', line 17

def process_env
  # parameters
  super
  @env["action_dispatch.request.parameters"] = @params
  @env["action_dispatch.request.request_parameters"] = @params
end