Merge pull request #2036 from fighterleslie/pr-hash

[ruby/en] Replace Hash#has_key? with Hash#key?
This commit is contained in:
ven 2015-11-23 08:20:52 +01:00
commit 2d67c58d7f

View File

@ -230,8 +230,8 @@ new_hash = { defcon: 3, action: true }
new_hash.keys #=> [:defcon, :action] new_hash.keys #=> [:defcon, :action]
# Check existence of keys and values in hash # Check existence of keys and values in hash
new_hash.has_key?(:defcon) #=> true new_hash.key?(:defcon) #=> true
new_hash.has_value?(3) #=> true new_hash.value?(3) #=> true
# Tip: Both Arrays and Hashes are Enumerable # Tip: Both Arrays and Hashes are Enumerable
# They share a lot of useful methods such as each, map, count, and more # They share a lot of useful methods such as each, map, count, and more