Created
August 3, 2012 21:18
-
-
Save slant/3251649 to your computer and use it in GitHub Desktop.
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 Person | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def love(subject, duration) | |
"#{self} #{__method__} #{subject} #{duration}" | |
end | |
def to_s | |
@name | |
end | |
end | |
me = Person.new('Me') | |
print me.love(:you, 'long time') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby -e "$(curl -L https://raw.github.com/gist/3251649/15c752af67ebb101e207bc487b89d5a38897a6a6/love.rb)"