"Casper" <caspertonka / yahoo.com> writes:

> 1.   class MyController < ActionController::Base
> 2.     helper :my_helper
> 3.   end
>
> I see this construct in Ruby on Rails a lot, and I don't know what is
> going on in line 2.
>
> Is this invoking a method called "helper" with the argument
> ":my_helper"?

Exactly.

> And if so, when does this get invoked?

When that part of the code is reached.

Class bodies are executed just like normal code, with `self' bound to
the class object, so the following example code

   puts 123
   class Foo ; puts self end
   puts 456

produces the following output:

   123
   Foo
   456

-- 
Daniel Brockman <daniel / brockman.se>

    So really, we all have to ask ourselves:
    Am I waiting for RMS to do this?   --TTN.