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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top