D
David A. Black
Hi --
This probably lies somewhere between obfuscated and pointless, but I
thought it was a fun example of Ruby's nimbleness:
class C
attr_reader :to_s
def initialize(str)
@to_s = str
end
end
s = C.new("hello")
puts s # hello
David
This probably lies somewhere between obfuscated and pointless, but I
thought it was a fun example of Ruby's nimbleness:
class C
attr_reader :to_s
def initialize(str)
@to_s = str
end
end
s = C.new("hello")
puts s # hello
David