Reputation: 1267
Why am I seeing this warning?
me = { 'name' => 'mezbah'}
me.index('mezbah') # => warning: Hash#index is deprecated; use Hash#key
Upvotes: 3
Views: 1732
Reputation: 168121
Deprecated means that it was a feature in the past, and is still is but is not recommended to be used, and is planned to be removed from the feature in future version of Ruby, so you better not use it. In this particular case, follow the message and use key
instead.
Upvotes: 7