Answer the question
In order to leave comments, you need to log in
Why does a Rack application need to be an object and not a class?
All introductions to Rack emphasize that an application should be an object, not a class. Why? After all, this code will work:
class MyApp
def self.call(env)
[200,{},["text"]]
end
end
Answer the question
In order to leave comments, you need to log in
The application must respond to the "call" method.
So both MyApp.call and MyApp.new.call are valid
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question