Created
November 14, 2011 23:09
-
-
Save bryanmikaelian/1365522 to your computer and use it in GitHub Desktop.
Simple ruby example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Puppy | |
def bark | |
puts 'Woof' | |
end | |
def wag_tail | |
unless self.sad? | |
puts '<wags tail>' | |
end | |
end | |
end | |
# What happens here? | |
p = Puppy.new | |
p.bark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment