[Rails] Re: global methods under object supposedly unaccessible

2012-10-03 Thread Frederick Cheung
On Wednesday, October 3, 2012 6:08:31 AM UTC+1, John Merlino wrote: However, in the above example, I was forced to use the private method. The documentation says any global methods declared outside of a class definition - those methods are defined as private instance methods of Object.

[Rails] Re: global methods under object supposedly unaccessible

2012-10-02 Thread John Merlino
A private method is internal to the implementation of a class, and it can only be called by other instance methods of the class (or its subclasses). Private methods are implicitly invoked on self, and may not be explicitly invoked on an object. If m is a private method, then you must ibnvoke it in

[Rails] Re: global methods under object supposedly unaccessible

2012-09-23 Thread 7stud --
1) Post the definition of private. 2) Execute this program: puts 'hello' 3) What conclusions do you draw from that? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send