Skip to content

Instantly share code, notes, and snippets.

@wnuqui
Created May 29, 2012 03:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wnuqui/2822263 to your computer and use it in GitHub Desktop.
a friendly Ruby Object!
class Foo
def to_s
"I am friendly. You can debug here thru formatted string."
end
end
foo = Foo.new # "I am friendly. You can debug here thru formatted string."
foo # "I am friendly. You can debug here thru formatted string."
# alternatively
class Foo
def inspect
"I am friendly. You can debug here thru formatted string."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment