On Mon, Jun 16, 2008 at 7:59 AM, Pascal J. Bourguignon
<pjb / informatimago.com> wrote:
> Tom Cloyd <tomcloyd / comcast.net> writes:
>
>> Robert Dober wrote:
>>> Why not write a simple wrapper?
>>>
>>> Ruby 1.9
>>> class String
>>>    def mysub! *args, &blk
>>>        tap{ gsub!( *args, &blk ) }
>>>    end
>>> end
>>>
>>> Ruby 1.8 or 1.9 too ;)
>>>    ...
>>>    def mysub!...
>>>          gsub!....
>>>          self
>>>    end
>>>
>>>
>>> Cheers
>>> Robert
>>>
>> Simple answer: I don't know the idiom. I have no idea what you just
>> said. None. Wrappers in my world are for candy. (!) I haven't caught up
>> yet with your *last* code, but I'm working on it. Then I'll go to work
>> on THIS. I much appreciate the learning challenges you're sending my
>> way. Hope some others are benefiting as well.
>
> It's the same as with candy.  If you don't like the color of your
> candy, you take a paper of some other color, and wrap it over the
> candy.  If you still don't like the pattern of this layer, you add
> another wrapper with a better pattern, and so on.
>
> So instead of touching/looking at the candy, you just touch and look
> the wrapper.
>
> Instead of using gsub, which you don't like, use your wrapper method.
>
>
> --
> __Pascal Bourguignon__
>
>

you can always do something simple like:

#{row.foo ? row.foo.gsub(%r{[',()\\\/]},"") : "Dont Be Nil, be somthing else"}