Skip to content

Instantly share code, notes, and snippets.

@slant
Created August 3, 2012 21:18
Show Gist options
  • Save slant/3251649 to your computer and use it in GitHub Desktop.
Save slant/3251649 to your computer and use it in GitHub Desktop.
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')
@slant
Copy link
Author

slant commented Aug 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment