class ActiveSupport::HashWithIndifferentAccess
def convert_value(value, conversion: nil)
Experimental RBS support (using type sampling data from the type_fusion
project).
type ActiveSupport__HashWithIndifferentAccess_convert_value_value = String | true | Array[String] | ActionController::Parameters | Hash | Array[Array, String, String, String] type ActiveSupport__HashWithIndifferentAccess_convert_value_return_value = String | true | ActionController::Parameters | Hash def convert_value: (ActiveSupport__HashWithIndifferentAccess_convert_value_value value, conversion: Symbol?) -> ActiveSupport__HashWithIndifferentAccess_convert_value_return_value
This signature was generated using 51 samples from 3 applications.
def convert_value(value, conversion: nil) if value.is_a? Hash if conversion == :to_hash value.to_hash else value.nested_under_indifferent_access end elsif value.is_a?(Array) if conversion != :assignment || value.frozen? value = value.dup end value.map! { |e| convert_value(e, conversion: conversion) } else value end end