class ActionDispatch::Request::Utils::CustomParamEncoder
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/action_dispatch/request/utils.rbs class ActionDispatch::Request::Utils::CustomParamEncoder def self.action_encoding_template: (ActionDispatch::Request request, String controller, String action) -> nil def self.encode: (ActionDispatch::Request request, Hash params, String controller, String action) -> Hash end
:nodoc:
def self.action_encoding_template(request, controller, action) # :nodoc:
Experimental RBS support (using type sampling data from the type_fusion
project).
def self.action_encoding_template: (ActionDispatch::Request request, String controller, String action) -> nil
This signature was generated using 4 samples from 2 applications.
def self.action_encoding_template(request, controller, action) # :nodoc: request.controller_class_for(controller).action_encoding_template(action) rescue MissingController nil end
def self.encode(request, params, controller, action)
Experimental RBS support (using type sampling data from the type_fusion
project).
def self.encode: (ActionDispatch::Request request, params, String controller, String action) ->
This signature was generated using 2 samples from 1 application.
def self.encode(request, params, controller, action) return params unless controller && controller.valid_encoding? && encoding_template = action_encoding_template(request, controller, action) params.except(:controller, :action).each do |key, value| ActionDispatch::Request::Utils.each_param_value(value) do |param| if encoding_template[key.to_s] param.force_encoding(encoding_template[key.to_s]) end end end params end