class ActionDispatch::Request::Utils

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/action_dispatch/request/utils.rbs

class ActionDispatch::Request::Utils
  def self.check_param_encoding: ((Hash | Array[Array, String, Array, String, Array, String, Array, Array, String, Array, , String] | String) params) -> Hash?
  def self.normalize_encode_params: (Hash params) -> Hash
  def self.set_binary_encoding: (ActionDispatch::Request request, Hash params, String controller, String action) -> Hash
end

:nodoc:

def self.check_param_encoding(params)

Experimental RBS support (using type sampling data from the type_fusion project).

type ActionDispatch__Request__Utils_check_param_encoding_params =  | String | controller | String | action | String | gem | String | version | String | class | String | name | String | controller | String | action | String | gem | String | version | String | q | String
type ActionDispatch__Request__Utils_check_param_encoding_return_value = nil | controller | String | action | String | gem | String | version | String | class | String | name | String | controller | String | action | String | gem | String | version | String |  | q | String

def self.check_param_encoding: (ActionDispatch__Request__Utils_check_param_encoding_params params) -> ActionDispatch__Request__Utils_check_param_encoding_return_value

This signature was generated using 18 samples from 2 applications.

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 for consistency with Rack.
      # ActionDispatch::Request#GET will re-raise as a BadRequest error.
      raise Rack::Utils::InvalidParameterError, "Invalid encoding for parameter: #{params.scrub}"
    end
  end
end

def self.each_param_value(params, &block)

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

def self.normalize_encode_params(params)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.normalize_encode_params: ( params) ->

This signature was generated using 2 samples from 1 application.

def self.normalize_encode_params(params)
  if perform_deep_munge
    NoNilParamEncoder.normalize_encode_params params
  else
    ParamEncoder.normalize_encode_params params
  end
end

def self.set_binary_encoding(request, params, controller, action)

Experimental RBS support (using type sampling data from the type_fusion project).

type ActionDispatch__Request__Utils_set_binary_encoding_params = controller | String | action | String | gem | String | version | String |  | controller | String | action | String | controller | String | action | String | gem | String | version | String | id | String

def self.set_binary_encoding: (ActionDispatch::Request request, ActionDispatch__Request__Utils_set_binary_encoding_params params, String controller, String action) -> ( | controller | String | action | String | controller | String | action | String | gem | String | version | String | id | String)

This signature was generated using 10 samples from 2 applications.

def self.set_binary_encoding(request, params, controller, action)
  CustomParamEncoder.encode(request, params, controller, action)
end