What is the syntax for calling a class method from an instance method? Suppose I have the following
class Class1
def initialize
#instance method
self.class.edit
puts "hello"
end
def self.edit
#class method
"ha"
end
end
c= Class1
When I run this code, I get no outputs.
Class1.new.initializeis an instance method, so it must be invoked on an instance ofClass1.Class1.newcreates the instance, invokesinitializeon it and then returns the instance.