classMagicString<Stringdef+@upcaseenddef-@downcaseenddef~# Do a ROT13 transformation - http://en.wikipedia.org/wiki/ROT13tr'A-Za-z','N-ZA-Mn-za-m'enddefto_procProc.new{self+" hello"}enddefto_a[self.reverse]enddef!swapcaseendendstr=MagicString.new("This is my string!")p+str# => "THIS IS MY STRING!"p~str# => "Guvf vf zl fgevat!"p+~str# => "GUVF VF ZL FGEVAT!"p%w(a b).map(&str)# => ["This is my string! hello", "This is my string! hello"]p*str# => "!gnirts ym si sihT"p!str# => "tHIS IS MY STRING!"p(notstr)# => "tHIS IS MY STRING!"p!(~str)# => "gUVF VF ZL FGEVAT!"