Sha256: 684c447be6545ab19117b24624d5dd3f1c14b65e8317b50321976d9291c48ad8

Contents?: true

Size: 349 Bytes

Versions: 12

Compression:

Stored size: 349 Bytes

Contents

require 'active_support/hash_with_indifferent_access'

class Hash

  # Returns an +ActiveSupport::HashWithIndifferentAccess+ out of its receiver:
  #
  #   {:a => 1}.with_indifferent_access["a"] # => 1
  #
  def with_indifferent_access
    hash = ActiveSupport::HashWithIndifferentAccess.new(self)
    hash.default = self.default
    hash
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
activesupport-3.0.0.rc lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.5 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.4 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.3 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.2 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.1 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.1.0 lib/active_support/core_ext/hash/indifferent_access.rb
csd-0.0.16 lib/active_support/core_ext/hash/indifferent_access.rb
activesupport-3.0.0.beta4 lib/active_support/core_ext/hash/indifferent_access.rb
activesupport-3.0.0.beta3 lib/active_support/core_ext/hash/indifferent_access.rb
activesupport-3.0.0.beta2 lib/active_support/core_ext/hash/indifferent_access.rb
activesupport-3.0.0.beta lib/active_support/core_ext/hash/indifferent_access.rb