I can’t seem to see what’s up with this piece of code:
class Cherry
class << self
def call env
self::Application.call
end
end
end
class Cherry
class Application
def call env
#Framework logic
end
end
end
run Cherry
That’s the part of my application that is not working. I have no idea why:
NoMethodError at / undefined method 'call' for Cherry::Application:Class
You need to adjust a couple of things.
When you are defining the
callmethod inside ofApplication, you are defining it as an instance method, then you are attempting to call it as a class method, so lets fix the definition to be a class method definition:Next there will be a new error, about not passing the right number of arguments to the
callmethod, so we add theenvparam to where you are calling thecallmethod.Hope that helps!