Can you explain the difference between ActiveSupport’s “HashWithIndifferentAccess” and Ruby’s “Hash”?

Technology CommunityCategory: Ruby on RailsCan you explain the difference between ActiveSupport’s “HashWithIndifferentAccess” and Ruby’s “Hash”?
VietMX Staff asked 3 years ago

The HashWithIndifferentAccess class will treat symbol keys and string keys as equivalent while the Hash class in Ruby will use the stricter = = comparison on keys—an equivalent string key will not retrieve the value for a given symbol key.