Ruby - Class Methods and Variables
Why does defining a method with
self.method_name inside a Ruby class create a class method instead of an instance method?self.method_name inside a Ruby class create a class method instead of an instance method?self inside a class bodyself refers to the class object itself.self.method_name creates a method on the class object, making it a class method.self inside the class body refers to the class itself, not instances. -> Option C15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions