Skip to content

Instantly share code, notes, and snippets.

@alebaffa
Created March 4, 2014 14:57
Show Gist options
  • Save alebaffa/9347948 to your computer and use it in GitHub Desktop.
Save alebaffa/9347948 to your computer and use it in GitHub Desktop.
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