Module#public (a private method) works in one of two ways: 1) it receives a list of symbols with method names, those methods are decorated as public. 2) it receives no arguments, in which case all methods defined from that point forward (until another visibility declaration is encountered in the class definition or the class closed) are public.
Same with Module#protected and Module#private. So what he's doing is turning logged_in?, current_user and authorized into public methods. Of course, a 30 second trip in google land would have led you to the ruby documentation, where you'd have found a good explanation with examples. Or, running `ri public` would've steered you in the right direction. -foca /me wishes people used ri more. On Wed, Dec 17, 2008 at 12:45 PM, James Byrne <li...@ruby-forum.com> wrote: > > Andrew Premdas wrote: >> Doing this for Restful-Authentication I add the following in >> features/support/env.rb >> >> # Make visible for testing >> ApplicationController.send(:public, :logged_in?, :current_user, >> :authorized?) >> > > Forgive my ignorance but would you do me the favour of explaining > exactly what this does? I can guess but I would rather have a clear > understanding of how this construct works so that I can generalize its > application. > > Regards, > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users