Class: ActionDispatch::Request::Utils
- Inherits:
-
Object
- Object
- ActionDispatch::Request::Utils
show all
- Defined in:
- actionpack/lib/action_dispatch/request/utils.rb
Overview
Defined Under Namespace
Classes: CustomParamEncoder, NoNilParamEncoder, ParamEncoder
Class Method Summary
collapse
Class Method Details
.check_param_encoding(params) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'actionpack/lib/action_dispatch/request/utils.rb', line 29
def self.check_param_encoding(params)
case params
when Array
params.each { |element| check_param_encoding(element) }
when Hash
params.each_value { |value| check_param_encoding(value) }
when String
unless params.valid_encoding?
raise Rack::Utils::InvalidParameterError, "Invalid encoding for parameter: #{params.scrub}"
end
end
end
|
.each_param_value(params, &block) ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'actionpack/lib/action_dispatch/request/utils.rb', line 10
def self.each_param_value(params, &block)
case params
when Array
params.each { |element| each_param_value(element, &block) }
when Hash
params.each_value { |value| each_param_value(value, &block) }
when String
block.call params
end
end
|
.normalize_encode_params(params) ⇒ Object
.set_binary_encoding(request, params, controller, action) ⇒ Object
44
45
46
|
# File 'actionpack/lib/action_dispatch/request/utils.rb', line 44
def self.set_binary_encoding(request, params, controller, action)
CustomParamEncoder.encode(request, params, controller, action)
end
|