Skip to content

Commit

Permalink
Ruby updates
Browse files Browse the repository at this point in the history
  • Loading branch information
adambard committed Jul 4, 2013
1 parent fbd54a7 commit 3840036
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ruby.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
language: ruby
contributors:
- ["David Underwood", "http://theflyingdeveloper.com"]
- ["Joel Walden", "http://joelwalden.net"]
---

```ruby
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -303,4 +304,4 @@ dwight.name #=> "Dwight K. Schrute"

# Call the class method
Human.say("Hi") #=> "Hi"
```
```

0 comments on commit 3840036

Please sign in to comment.