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



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

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

#[]=(key, value) ⇒ Object



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

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

#delete(key, &block) ⇒ Object



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

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

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



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

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

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

Returns:

  • (Boolean)


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

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