instance method
[]=
Ruby on Rails 4.0.13
Since v2.2.3 Last seen in v4.2.9Signature
[]=(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 94
def []=(key, value)
regular_writer(convert_key(key), convert_value(value, for: :assignment))
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 94
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in HashWithIndifferentAccess