instance method
[]=
Ruby on Rails 7.1.6
Since v3.0.20Signature
[]=(key, value)
Assigns a new value to the hash:
hash = ActiveSupport::HashWithIndifferentAccess.new hash[:key] = 'value'
This value can be later fetched using either :key or 'key'.
Parameters
-
keyreq -
valuereq
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 98
def []=(key, value)
regular_writer(convert_key(key), convert_value(value, conversion: :assignment))
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 98
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess