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
47 48 49 |
# File 'lib/devise/rails/warden_compat.rb', line 47 def [](key) super(convert_key(key)) end |
#[]=(key, value) ⇒ Object Also known as: store
51 52 53 |
# File 'lib/devise/rails/warden_compat.rb', line 51 def []=(key, value) regular_writer(convert_key(key), value) end |
#delete(key) ⇒ Object
84 85 86 |
# File 'lib/devise/rails/warden_compat.rb', line 84 def delete(key) super(convert_key(key)) end |
#fetch(key, *extras) ⇒ Object
72 73 74 |
# File 'lib/devise/rails/warden_compat.rb', line 72 def fetch(key, *extras) super(convert_key(key), *extras) end |
#key?(key) ⇒ Boolean Also known as: include?, has_key?, member?
64 65 66 |
# File 'lib/devise/rails/warden_compat.rb', line 64 def key?(key) super(convert_key(key)) end |
#merge(hash) ⇒ Object
80 81 82 |
# File 'lib/devise/rails/warden_compat.rb', line 80 def merge(hash) self.dup.update(hash) end |
#regular_update ⇒ Object
45 |
# File 'lib/devise/rails/warden_compat.rb', line 45 alias_method :regular_update, :update |
#regular_writer ⇒ Object
44 |
# File 'lib/devise/rails/warden_compat.rb', line 44 alias_method :regular_writer, :[]= |
#stringify_keys ⇒ Object
89 |
# File 'lib/devise/rails/warden_compat.rb', line 89 def stringify_keys; dup end |
#stringify_keys! ⇒ Object
88 |
# File 'lib/devise/rails/warden_compat.rb', line 88 def stringify_keys!; self end |
#symbolize_keys ⇒ Object
92 |
# File 'lib/devise/rails/warden_compat.rb', line 92 def symbolize_keys; to_hash.symbolize_keys end |
#to_hash ⇒ Object
95 |
# File 'lib/devise/rails/warden_compat.rb', line 95 def to_hash; Hash.new.update(self) end |
#to_options! ⇒ Object
94 |
# File 'lib/devise/rails/warden_compat.rb', line 94 def ; self end |
#update(other_hash) ⇒ Object Also known as: merge!
57 58 59 60 |
# File 'lib/devise/rails/warden_compat.rb', line 57 def update(other_hash) other_hash.each_pair { |key, value| regular_writer(convert_key(key), value) } self end |
#values_at(*indices) ⇒ Object
76 77 78 |
# File 'lib/devise/rails/warden_compat.rb', line 76 def values_at(*indices) indices.collect {|key| self[convert_key(key)]} end |