Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created June 20, 2012 18:13
Show Gist options
  • Select an option

  • Save practicingruby/2961323 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/2961323 to your computer and use it in GitHub Desktop.
class Person
alias_method :inspect, :to_s
def initialize(name, email)
@name = name
@email = email
end
def to_s
"#{@name} <#{@email}>"
end
end
person = Person.new("Gregory Brown", "gregory@practicingruby.com")
p person
puts person
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment