Skip to content

Instantly share code, notes, and snippets.

@khustochka
Last active August 29, 2015 13:56
Show Gist options
  • Save khustochka/9202653 to your computer and use it in GitHub Desktop.
Save khustochka/9202653 to your computer and use it in GitHub Desktop.
[1] pry(main)> RUBY_VERSION
=> "2.1.0"
[2] pry(main)> require 'active_support/hash_with_indifferent_access'
=> true
[3] pry(main)> h = ActiveSupport::HashWithIndifferentAccess.new({a: 1})
=> {"a"=>1}
[4] pry(main)> x = h.reject {|_, v| v.nil? }
=> {"a"=>1}
[5] pry(main)> x.class
=> ActiveSupport::HashWithIndifferentAccess
[1] pry(main)> RUBY_VERSION
=> "2.1.1"
[2] pry(main)> require 'active_support/hash_with_indifferent_access'
=> true
[3] pry(main)> h = ActiveSupport::HashWithIndifferentAccess.new({a: 1})
=> {"a"=>1}
[4] pry(main)> x = h.reject {|_, v| v.nil? }
=> {"a"=>1}
[5] pry(main)> x.class
=> Hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment