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.

Direct Known Subclasses

FileUpload

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



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

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

#[]=(key, value) ⇒ Object



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

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

#delete(key, &block) ⇒ Object



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

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

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



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

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

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

Returns:

  • (Boolean)


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

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