Robert, could you explain a bit more what you mean?

Do you mean adding the code directly to the original string.rb file?
Where is that located?

Are there other solutions?

/M

Robert Dober wrote:
> On Tue, May 6, 2008 at 10:47 PM, Zoop Zoop <manuel.meurer / gmail.com> 
> wrote:
>> I want to extend the String class with a capitalize_each_word method
>>  (http://donttrustthisguy.com/2005/12/31/ruby-extending-classes-and-method-chaining/)
>>  What is the recommended place to put the code?
>>  --
>>  Posted via http://www.ruby-forum.com/.
>>
>>
> I would clearly monkeypatch String itself.
> 
> class String
>    def cap_each.....
> 
> 
> HTH
> Robert
> 
> 
> --
> http://ruby-smalltalk.blogspot.com/
> 
> ---
> Whereof one cannot speak, thereof one must be silent.
> Ludwig Wittgenstein

-- 
Posted via http://www.ruby-forum.com/.