I got confused about the title part while learning about Ruby, so I looked at them all together to organize them.
class Example
def index
end
end
①example = Example.new
example.index // Call from instance → ○
② Example.index // Cannot be called directly from the class → When using this, add self. To the method (self.index)
index // Of course this will display an error
In short, when calling a basic method, create an instance and call it from there (①). → Instance method
A method to call a method without creating an instance as in (2). → Class method
An image like that.
The advantage of using a class method is that it can be used as a method that does not include information on other instances (I did not know a specific example, so I will summarize it as soon as I understand it). First of all, it is related to the class, but it seems OK to recognize that it is an independent method that does not include information on other instances.