it looks as if it is onyl available on the class because if you look
it says self.class.fallbacks, yet that wouldnt make sense either
because then what would be the point of its existance if you had to
reach the class for it it, why not just create a class level macro
instead?

On Sep 9, 3:10 pm, John Merlino <stoici...@aol.com> wrote:
> Rails extends Ruby with mattr_accessor (Module accessor). As Ruby's
> attr_accessor generates getter/setter methods for instances,
> mattr_accessor provide getter/setter methods at the module level. In
> below example, you see that mattr_accessor declared in the class
> context of LookupContext. It's declared in class, not module. However,
> modules are defined in LookupContext, for example, the module
> ViewPaths, which makes use of the accessor. So is it safe to say that
> if a module accessor is declared in class, then it can only be
> available to modules of that class?
>
>   class LookupContext
>     mattr_accessor :fallbacks
>     module ViewPaths
>       self.class.fallbacks.each do |resolver|

-- 
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 https://groups.google.com/groups/opt_out.


Reply via email to