Skip to content

Instantly share code, notes, and snippets.

@wnuqui wnuqui/gist:2822263

Created May 29, 2012
Embed
What would you like to do?
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
You can’t perform that action at this time.