For me, protected methods only make sense as instance methods.
Protected methods can be called by other instances of the same class.
class Student
def initialize(age)
@age = age
end
def older_than?(other)
age > other.age
end
protected
def age
@age
end
end
You can't directly call age on a Student instance
student1 = Student.new(21)
student1.age
NoMethodError: protected method `age' called for #<Student:0x514d058 @age=21>
But student1 can reference student2's age
student2 = Student.new(23)
student2.older_than?(student1)
=> true
So you can see how an instance's protected methods uniqueness is its ability to be referenced from another instance.
I can't see how you would use a class "protected method"... there's no scenario similar to the above.
EDIT
Thanks to Cary Swoveland completely messing with my mind, I realise you can do the following...
class Class
def show_k(klass)
klass.k
end
protected
def k
"This is k"
end
end
Now if I do
String.k
NoMethodError: protected method `k' called for String:Class
But if I do...
Integer.show_k(String)
=> "This is k"
Possible because classes are instances of the Class class.
I'm still not sure how I'd use this, but there you go.