Created
March 4, 2014 14:57
-
-
Save alebaffa/9347948 to your computer and use it in GitHub Desktop.
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 Dog | |
def initialize(name) | |
@name = name | |
end | |
def bark | |
puts "#{@name} says woof!" | |
end | |
def eat | |
puts "#{@name} is eating..." | |
end | |
def chase_cat | |
puts "#{@name} is following the cat!" | |
end | |
end | |
leo = Dog.new('Leo') | |
leo.bark | |
leo.eat | |
leo.chase_cat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment