From: Daniel Finnie Date: 2006-12-15T09:59:50+09:00 Subject: Why is define_method private? Plus, what's the point of private methods? Why is define_method a private method? I can't recall ever using define_method on the class I was working in, only using class.send(:define_method).... Personally, I find that the following: Class.define_method(:foo, &myBlock) is much cleaner than this: Class.send(:define_method, :foo, &myBlock) What are the advantages to having define_method be private? Are there any cons to having it public? I can find one con to having it private and no pros, which leads my to my main question...why is it private? Also, a quick philosophy question: What is the point of private methods if you can bypass their private status so easily? I know it isn't meant as a security measure or anything but it just seems silly. The only reason I can think of is having too many methods cluttering up the RDocs if everything was public, but this is easily solved by having a method being private just meaning that it doesn't show up in the docs. The same arguments apply to protected methods also, IMO. Now, I know someone will mention that Ruby 1.9 won't allow calling private methods with an explicit receiver through send, but, according to my "research," Kernel#__send and Kernel#funcall will. (http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9#l22) Thanks, Dan Finnie