Last active
December 17, 2015 19:09
-
-
Save vosechu/5658490 to your computer and use it in GitHub Desktop.
Dog/cat get in fight
This file contains hidden or 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 bark_at(cat) | |
"Curse you #{cat}!!" | |
end | |
end | |
class Cat | |
def initialize(name) | |
@name = name | |
end | |
def to_s | |
sleep 3 | |
@name | |
end | |
end | |
c = Cat.new('meowkins') | |
d = Dog.new | |
d.bark_at(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment