Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/insensitive_hash.rb

Direct Known Subclasses

InsensitiveHash

Instance Method Summary collapse

Instance Method Details

#insensitive(options = {}) ⇒ InsensitiveHash

Returns:



6
7
8
9
10
11
12
# File 'lib/insensitive_hash.rb', line 6

def insensitive options = {}
  InsensitiveHash[self].tap do |ih|
    ih.safe         = options[:safe] if options.has_key?(:safe)
    ih.default      = self.default
    ih.default_proc = self.default_proc if self.default_proc
  end
end