class X
def initialize
@name = "Bob"
end
blah blah
end
puts X.new # I want this to print X:Bob
puts [X.new, X.new] # I want this to print [X:Bob, X:Bob]
class X def initialize @name = Bob end blah blah end puts X.new #
Share
Override the
to_smethod of your class: