Simple question, but one that I've been curious about...is there a functional difference between the following two commands?
String::class
String.class
They both do what I expect -- that is to say they return Class
-- but what is the difference between using the ::
and the .
?
I notice that on those classes that have constants defined, IRB's auto-completion will return the constants as available options when you press tab after ::
but not after .
, but I don't know what the reason for this is...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…