Sha256: d2f1365286bc2d4b16b8ac441e6bde6d36f36f20c5248680ad122dd6a9e14df3

Contents?: true

Size: 907 Bytes

Versions: 172

Compression:

Stored size: 907 Bytes

Contents

require 'active_support/hash_with_indifferent_access'

class Hash

  # Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:
  #
  #   {:a => 1}.with_indifferent_access["a"] # => 1
  #
  def with_indifferent_access
    ActiveSupport::HashWithIndifferentAccess.new_from_hash_copying_default(self)
  end

  # Called when object is nested under an object that receives
  # #with_indifferent_access. This method will be called on the current object
  # by the enclosing object and is aliased to #with_indifferent_access by
  # default. Subclasses of Hash may overwrite this method to return +self+ if
  # converting to an <tt>ActiveSupport::HashWithIndifferentAccess</tt> would not be
  # desirable.
  #
  #   b = {:b => 1}
  #   {:a => b}.with_indifferent_access["a"] # calls b.nested_under_indifferent_access
  #
  alias nested_under_indifferent_access with_indifferent_access
end

Version data entries

172 entries across 136 versions & 19 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
classiccms-0.7.4 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
classiccms-0.7.3 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
classiccms-0.7.2 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
classiccms-0.7.1 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
classiccms-0.7.0 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/hash/indifferent_access.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
font-awesome-rails-3.1.1.2 vendor/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
font-awesome-rails-3.1.1.1 vendor/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
challah-1.0.0.beta vendor/bundle/gems/activesupport-3.2.11/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/indifferent_access.rb