Class: Tina4::IndifferentHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/tina4/request.rb

Overview

A Hash subclass that supports indifferent access (both string and symbol keys). Used by Request#params so that params and params both work.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/tina4/request.rb', line 9

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

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/tina4/request.rb', line 13

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

#delete(key, &block) ⇒ Object



27
28
29
# File 'lib/tina4/request.rb', line 27

def delete(key, &block)
  super(convert_key(key), &block)
end

#fetch(key, *args, &block) ⇒ Object



17
18
19
# File 'lib/tina4/request.rb', line 17

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

#key?(key) ⇒ Boolean Also known as: has_key?, include?

Returns:

  • (Boolean)


21
22
23
# File 'lib/tina4/request.rb', line 21

def key?(key)
  super(convert_key(key))
end