instance method
convert_value
Ruby on Rails 6.0.6
Since v3.0.20 PrivateSignature
convert_value(value, options = {})
No documentation comment.
Parameters
-
valuereq -
optionsopt = {}
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 370
def convert_value(value, options = {}) # :doc:
if value.is_a? Hash
if options[:for] == :to_hash
value.to_hash
else
value.nested_under_indifferent_access
end
elsif value.is_a?(Array)
if options[:for] != :assignment || value.frozen?
value = value.dup
end
value.map! { |e| convert_value(e, options) }
else
value
end
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 370
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess