Define plus operator
class MyClass def initialize(string) @value = string.gsub(/[aeiou]/, '*') end def +(other) MyClass.new(self.to_s + other.to_s) end def to_s @value end def inspect @value end end a = MyClass.new("damn ") a += "shame"