rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
* call rack middleware inside method
@ 2013-05-22  9:18 John Mayor
  0 siblings, 0 replies; only message in thread
From: John Mayor @ 2013-05-22  9:18 UTC (permalink / raw)
  To: rack-devel

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

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.

require 'rubygems'
require 'bundler'
require './app'
run App

class App < Sinatra::Base

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


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|



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?



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.

[-- Attachment #2: Type: text/html, Size: 1586 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-22 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22  9:18 call rack middleware inside method John Mayor

rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/rack-devel

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 rack-devel rack-devel/ https://public-inbox.org/rack-devel \
	public-inbox-index rack-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git