From 3840036912bc8e5a31b45cfa6ef7eae993e7464b Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 3 Jul 2013 22:53:12 -0700 Subject: Ruby updates --- ruby.html.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ruby.html.markdown') diff --git a/ruby.html.markdown b/ruby.html.markdown index 2de134ae..4c41b133 100644 --- a/ruby.html.markdown +++ b/ruby.html.markdown @@ -2,6 +2,7 @@ language: ruby contributors: - ["David Underwood", "http://theflyingdeveloper.com"] + - ["Joel Walden", "http://joelwalden.net"] --- ```ruby @@ -154,7 +155,7 @@ new_hash = { defcon: 3, action: true} new_hash.keys #=> [:defcon, :action] # Tip: Both Arrays and Hashes are Enumerable -# This means 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 # Control structures @@ -277,8 +278,8 @@ class Human @name end - # A class method; uses self to distinguish from instance methods. (Can only be called on class, not an instance). - + # A class method uses self to distinguish from instance methods. + $ It can only be called on the class, not an instance. def self.say(msg) puts "#{msg}" end @@ -303,4 +304,4 @@ dwight.name #=> "Dwight K. Schrute" # Call the class method Human.say("Hi") #=> "Hi" -``` \ No newline at end of file +``` -- cgit v1.2.3