instance method
convert_value
Ruby on Rails 4.0.13
Since v3.0.20Signature
convert_value(value, options = {})
No documentation comment.
Parameters
-
valuereq -
optionsopt = {}
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 253
def convert_value(value, options = {})
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)
unless options[:for] == :assignment
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 253
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess