Class: Devise::IndifferentHash
- Inherits:
-
Hash
- Object
- Hash
- Devise::IndifferentHash
- Defined in:
- lib/devise/rails/warden_compat.rb
Overview
We cannot use Rails Indifferent Hash because it messes up the flash object.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object (also: #store)
- #delete(key) ⇒ Object
- #fetch(key, *extras) ⇒ Object
- #key?(key) ⇒ Boolean (also: #include?, #has_key?, #member?)
- #merge(hash) ⇒ Object
- #regular_update ⇒ Object
- #regular_writer ⇒ Object
- #stringify_keys ⇒ Object
- #stringify_keys! ⇒ Object
- #symbolize_keys ⇒ Object
- #to_hash ⇒ Object
- #to_options! ⇒ Object
- #update(other_hash) ⇒ Object (also: #merge!)
- #values_at(*indices) ⇒ Object
Instance Method Details
#[](key) ⇒ Object
45 46 47 |
# File 'lib/devise/rails/warden_compat.rb', line 45 def [](key) super(convert_key(key)) end |
#[]=(key, value) ⇒ Object Also known as: store
49 50 51 |
# File 'lib/devise/rails/warden_compat.rb', line 49 def []=(key, value) regular_writer(convert_key(key), value) end |
#delete(key) ⇒ Object
82 83 84 |
# File 'lib/devise/rails/warden_compat.rb', line 82 def delete(key) super(convert_key(key)) end |
#fetch(key, *extras) ⇒ Object
70 71 72 |
# File 'lib/devise/rails/warden_compat.rb', line 70 def fetch(key, *extras) super(convert_key(key), *extras) end |
#key?(key) ⇒ Boolean Also known as: include?, has_key?, member?
62 63 64 |
# File 'lib/devise/rails/warden_compat.rb', line 62 def key?(key) super(convert_key(key)) end |
#merge(hash) ⇒ Object
78 79 80 |
# File 'lib/devise/rails/warden_compat.rb', line 78 def merge(hash) self.dup.update(hash) end |
#regular_update ⇒ Object
43 |
# File 'lib/devise/rails/warden_compat.rb', line 43 alias_method :regular_update, :update |
#regular_writer ⇒ Object
42 |
# File 'lib/devise/rails/warden_compat.rb', line 42 alias_method :regular_writer, :[]= |
#stringify_keys ⇒ Object
87 |
# File 'lib/devise/rails/warden_compat.rb', line 87 def stringify_keys; dup end |
#stringify_keys! ⇒ Object
86 |
# File 'lib/devise/rails/warden_compat.rb', line 86 def stringify_keys!; self end |
#symbolize_keys ⇒ Object
90 |
# File 'lib/devise/rails/warden_compat.rb', line 90 def symbolize_keys; to_hash.symbolize_keys end |
#to_hash ⇒ Object
93 |
# File 'lib/devise/rails/warden_compat.rb', line 93 def to_hash; Hash.new.update(self) end |
#to_options! ⇒ Object
92 |
# File 'lib/devise/rails/warden_compat.rb', line 92 def ; self end |
#update(other_hash) ⇒ Object Also known as: merge!
55 56 57 58 |
# File 'lib/devise/rails/warden_compat.rb', line 55 def update(other_hash) other_hash.each_pair { |key, value| regular_writer(convert_key(key), value) } self end |
#values_at(*indices) ⇒ Object
74 75 76 |
# File 'lib/devise/rails/warden_compat.rb', line 74 def values_at(*indices) indices.collect {|key| self[convert_key(key)]} end |