I've been coding in Ruby for sometime now, but I don't understand when to use:
def self.METHOD_NAME
end
or just:
def METHOD_NAME
end
In any Rails model. Is "self" a modifier like private in Java? When should I use it and when not?. Thanks a ton.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…