diff options
Diffstat (limited to 'ruby.html.markdown')
-rw-r--r-- | ruby.html.markdown | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown index 1118e2dd..b7f8b4a1 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -14,6 +14,7 @@ contributors: - ["Rahil Momin", "https://github.com/iamrahil"] - ["Gabriel Halley", "https://github.com/ghalley"] - ["Persa Zula", "http://persazula.com"] + - ["Jake Faris", "https://github.com/farisj"] --- ```ruby @@ -53,7 +54,7 @@ You shouldn't either 10.* 5 #=> 50 # Special values are objects -nil # Nothing to see here +nil # equivalent to null in other languages true # truth false # falsehood @@ -131,7 +132,7 @@ puts "I'm printing!" # print to the output without a newline print "I'm printing!" -#=> I'm printing! => nill +#=> I'm printing! => nil # Variables x = 25 #=> 25 @@ -229,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 |