Class AWS::IndifferentHash
In: lib/aws/indifferent_hash.rb
Parent: Hash

A utility class to provide indifferent access to hash data.

Inspired by ActiveSupport‘s HashWithIndifferentAccess, this class has a few notable differences:

  • ALL keys are converted to strings (via to_s)
  • It does not deep merge/convert hashes indifferently
  • It will not perserve default value behaviours

These features were omitted because our primary use for this class is to wrap a 1-level hash as a return value, but we want the user to access the values with string or symbol keys.

@private

Methods

[]   []=   delete   fetch   has_key?   include?   key?   member?   merge   merge!   new   store   update  

External Aliases

[] -> _getter
_setter -> :

Public Class methods

Public Instance methods

include?(key)

Alias for has_key?

key?(key)

Alias for has_key?

member?(key)

Alias for has_key?

store(key, value)

Alias for #[]=

update(hash)

Alias for merge!

[Validate]