I'm really new to rack dev and have a stupid question.
I have a sinatra app and I need to use a rack middleware. Here's my code.

@config.ru
require 'rubygems'
require 'bundler'
require './app'
run App


@app.rb
...
class App < Sinatra::Base

use Rack::MyClass, {:param1 => "one", :param2 => "two"} do|output|
...
end

end

this works fine. the problem is that I need to call the rack middleware inside a method. something like this.

class App < Sinatra::Base

def my_method

use Rack::MyClass, {:param1 => "one", :param2 => "two"} do|output|
...
end

end

end


but unfortunately this does not work. can anyone give some help with this?
why it doesn't work and how can I find a solution for this?

thanks.

--
 
---
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.