面试题答案
一键面试class MyString
attr_accessor :text
def initialize(text = '')
@text = text
end
def <<(other)
@text << other.to_s
self
end
end
class MyString
attr_accessor :text
def initialize(text = '')
@text = text
end
def <<(other)
@text << other.to_s
self
end
end