Class: Appydave::Tools::Types::IndifferentAccessHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/appydave/tools/types/indifferent_access_hash.rb

Overview

Hash with indifferent access

Instance Method Summary collapse

Constructor Details

#initialize(initial_hash = {}) ⇒ IndifferentAccessHash

Returns a new instance of IndifferentAccessHash.



8
9
10
11
# File 'lib/appydave/tools/types/indifferent_access_hash.rb', line 8

def initialize(initial_hash = {})
  super()
  update(initial_hash)
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/appydave/tools/types/indifferent_access_hash.rb', line 13

def [](key)
  super(convert_key(key))
end

#[]=(key, value) ⇒ Object



17
18
19
# File 'lib/appydave/tools/types/indifferent_access_hash.rb', line 17

def []=(key, value)
  super(convert_key(key), value)
end

#delete(key) ⇒ Object



25
26
27
# File 'lib/appydave/tools/types/indifferent_access_hash.rb', line 25

def delete(key)
  super(convert_key(key))
end

#fetch(key, *args) ⇒ Object



21
22
23
# File 'lib/appydave/tools/types/indifferent_access_hash.rb', line 21

def fetch(key, *args)
  super(convert_key(key), *args)
end