On Tuesday, June 7, 2011 8:16:02 AM UTC-6, frizbe1605 wrote:
>
> Okay, I'm chaining methods. I want access to my class.


Access your class as in: obj.class (or something else)?
 

> I can access 
> SomeClass with a method like some_class.


Do you mean you can take a string "some_class" and call:

"some_class".camelize.constantize => SomeClass

Or, are you talking about some weird #method_missing-based feature of rails 
that I don't know about?
 

> Now with engines in Rails 
> 3.1, I can use modules to break apart my codebase.


Well, in general terms, with ruby you've always been able to "break apart" 
your codebase using modules...
 

> So now, SomeClass 
> would be Engine::SomeClass. If I try to access Engine::SomeClass with 
> a similar style method like engine_some_class, it returns with 
> EngineSomeClass rather than Engine::SomeClass.
>

So, I think the real question is, what do you mean by "it" in "it returns 
with..."? What method are you calling?

If I had to guess, it looks to me like you're not talking so much about 
calling a method #engine_some_class so much as passing this as a value 
(string or symbol) to some method. Am I on the right track?
 

>
> Any ideas on a chainable method for accessing this class now that it 
> has the additional module namespace? 
>

What do you mean by chainable here? Do you mean method chaining like:

obj.method_a.method_b.method_c(arg1, arg2).method_d

On Jun 6, 1:35 pm, Frederick Cheung <frederic...@gmail.com> 
> wrote: 
> > On Jun 6, 3:34 pm, frizbe1605 <frizb...@gmail.com> wrote:> 
> EngineBlogPost == @blog.engine_blog_post 
> > > Engine::BlogPost == ???????? 
> > 
> > You might want to elaborate - to me at least your question makes no 
> > sense. 
> > 
> > Fred. 
> > 
>

You need more elaboration still. I, like Fred, am still having a hard time 
knowing what you're getting at. 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/TlpZQlNnSEIzQUVK.
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.

Reply via email to