On Tue, May 18, 2010 at 8:15 AM, poseid <mulder.patrick / gmail.com> wrote:

> Hm... ok, this is more or less what I expected as well, when reading
> code employing instance/class variables. But how do I understand the
> (old) code from a book on Rails:
>
> class T < ActionView::Helpers::FormBuilder
> field_helpers.each do |s|
>   src = <<-END_SRC
>     def #{s}(field, options = {})
>      @template.content_tag( ... )
>     end
>   END_SRC
> class_eval src, __FILE__, __LINE__
> end
> end
>
> To me it seems that field_helpers is an instance variable, but there
> is no @ nor @@ used
>
> thanks for feedback
>
>

field_helpers is neither a class nor an instance variable... it is a
method that happens to return an array (or similar class that has a
.each).

-Jonathan Nielsen