Andy Triboletti
2007-Apr-09 20:42 UTC
namespaces in ruby - question about 2 classes with the same name
I have a report model class in app/models/report.rb. I also have a report class in the lib directory which is inside a namespace ChipIn::Reports. I am trying to access the app/models report class from within the Chipin::Reports namespace in the lib folder. Is this possible? Thanks Andy --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2007-Apr-09 21:15 UTC
Re: namespaces in ruby - question about 2 classes with the same name
Try ::Reports. That should knock you out to the global namespace and get what you want. Jason On 4/9/07, Andy Triboletti <andy-kRVt9sEkMUDQT0dZR+AlfA@public.gmane.org> wrote:> > > I have a report model class in app/models/report.rb. I also have a > report class in the lib directory which is inside a namespace > ChipIn::Reports. I am trying to access the app/models report class > from within the Chipin::Reports namespace in the lib folder. Is this > possible? > > Thanks > Andy > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andy Triboletti
2007-Apr-10 19:52 UTC
Re: namespaces in ruby - question about 2 classes with the same name
Thank you, putting :: before the class worked perfectly. On Apr 9, 2007, at 11:15 AM, Jason Roelofs wrote:> Try ::Reports. That should knock you out to the global namespace > and get what you want. > > Jason > > On 4/9/07, Andy Triboletti < andy-kRVt9sEkMUDQT0dZR+AlfA@public.gmane.org> wrote: > > I have a report model class in app/models/report.rb. I also have a > report class in the lib directory which is inside a namespace > ChipIn::Reports. I am trying to access the app/models report class > from within the Chipin::Reports namespace in the lib folder. Is this > possible? > > Thanks > Andy > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---