`private` and `private_class_method` aren’t just keywords, they take arguments e.g.
private :method_name private_class_method :class_method_name that will work consistently… I’ve never seen `private_class_method def self.class_method_name` in the wild I suspect that it only works by accident… Jon Rowe --------------------------- [email protected] jonrowe.co.uk On Thursday, 7 January 2016 at 19:47, Ravi (Tom) Hale wrote: > I'm trying to wrap my head around this seeming inconsistency. > > Tested with Ruby 2.2.3 > > On a line by itself > ------------------- > private - makes all following definitions private > private_class_method - *does nothing* - following methods are still > available publicly > > On the same line as a method definition > --------------------------------------- > private - fails: `private def self.priv`: test.rb:32:in `private': > undefined method `priv' for class `Self' (NameError) > private_class_method - works (with def self.methodname) > > Can anyone help out? > > If you too think it is worth reporting to the ruby developers, how would > I best go about informing them? > > Cheers, > Tom > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > Visit this group at https://groups.google.com/group/rails-oceania. > For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/rails-oceania. For more options, visit https://groups.google.com/d/optout.
