No, sorry. I'm trying to _truly_ make an attribute private. I want nobody but my instance (self) to be able to access this attribute. There's nothing like attr_private to my knowledge, though, so I declared private methods.
The problem is the basic order of the way ActiveRecord redefines :respond_to? 1. if regular respond_to? true, then return true 2. if matches an attribute, return true 3. return regular respond_to? There's no way for me to _prevent_ an attribute from being exposed publicly as far as respond_to? is concerned. -Gaius On Tue, Sep 2, 2008 at 3:08 PM, Damian Janowski <[EMAIL PROTECTED]> wrote: > > On Tue, Sep 2, 2008 at 4:07 PM, James Rosen <[EMAIL PROTECTED]> wrote: >> >> Ok, but what about >> >> $ irb >> irb(main):001:0> class Foo >> irb(main):002:1> def bar >> irb(main):003:2> end >> irb(main):004:1> private:bar >> irb(main):005:1> end >> => Foo >> irb(main):006:0> Foo.new.respond_to? :bar >> => false > > Well, we are talking about attr_protected, right? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
