instance method
convert_value
Ruby on Rails 6.1.7.10
Since v3.0.20 PrivateSignature
convert_value(value, conversion: nil)
No documentation comment.
Parameters
-
valuereq -
conversionkey = nil
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 381
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
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 381
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess