diff options
author | ven <vendethiel@hotmail.fr> | 2015-11-23 08:20:52 +0100 |
---|---|---|
committer | ven <vendethiel@hotmail.fr> | 2015-11-23 08:20:52 +0100 |
commit | 2d67c58d7f4ea457e756e0973bba0c25a499957e (patch) | |
tree | 4d31ab95dc5c435361e10eaa3a18ca9ab8cfd6b1 /ruby.html.markdown | |
parent | a3ef58088e558ffba1cbe74314e0044d90c14f79 (diff) | |
parent | e7dc56273f07066e2b4da1c02e3f723b8da834a0 (diff) |
Merge pull request #2036 from fighterleslie/pr-hash
[ruby/en] Replace Hash#has_key? with Hash#key?
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 243f788b..cf1a18e3 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -230,8 +230,8 @@ new_hash = { defcon: 3, action: true } new_hash.keys #=> [:defcon, :action] # Check existence of keys and values in hash -new_hash.has_key?(:defcon) #=> true -new_hash.has_value?(3) #=> true +new_hash.key?(:defcon) #=> true +new_hash.value?(3) #=> true # Tip: Both Arrays and Hashes are Enumerable # They share a lot of useful methods such as each, map, count, and more |