Kemal::Base.getand an instance method
Kemal::Base#get. Currently, when I call
getfrom inside a instance method, it calls the macro, but I would expect it to call the instance method. And it's ugly if you have to invoke the instance method with explicit receiver...
class MyApp < Kemal::Application get "/" do |env| "hello" end end MyApp.run
class MyApp < Kemal::Application get "/" do |env| "hello" end # `instance_routes` could be a macro that will define the `initialize_instance_routes` method instance_routes do # Here using `with .. yield`, the instance routes can be configured with another DSL (could be methods, .. whatever) get "/foo" do |env| "bar" end end end app = MyApp.new app.initialize_instance_routes app.run
getmethod would actually call
route_handler.add_route("GET", path, &block)