private class methods- functionality or shortcoming?

A

amit saxena

"> The Module#private method only works for instance methods,
not for class
method."

My question is, why is it so? What's the advantage in it?

Amit


From: Stefano Crocco <[email protected]>
Subject: Re: private class methods- functionality or shortcoming?
To: "ruby-talk ML" <[email protected]>
Date: Monday, June 9, 2008, 7:39 PM
class Abc

class<<self
private
def fun
p "hello"
end
end

end

class Abc

private
def self.fun
p "hello"
end

end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top