David Kahn wrote in post #977289: > On Mon, Jan 24, 2011 at 6:43 PM, Marnen Laibow-Koser > <li...@ruby-forum.com>wrote: > >> > >> > Is there a way I can write a method that uses the '<<' syntactic sugar? >> > Been >> > poking around and don't see clearly how to do this. >> >> def <<(other) >> # whatever >> end >> > > I see, so it has to be within a class
Module, actually. But this shouldn't surprise you: it's just a method like any other. > and not named.... It is named. Its name is :<< . > so if I am > writing > a helper method in app controller then this is weird, but now I see that > I > need to make a class for what I do, so thanks, my design has improved. Yeah. Don't put logic in your controllers. And remember that you can reopen or mix into existing classes. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.