Class: Routemaster::Drain::Basic

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/routemaster/drain/basic.rb

Overview

Rack application which authenticates, parses, and broadcasts events received from Routemaster.

See the various corresponding middleware for details on operation: Middleware::Authenticate, Middleware::Parse, and terminates with Terminator.

Instance Method Summary collapse

Methods included from Forwardable

_compile_method

Constructor Details

#initialize(options = {}) ⇒ Basic

Returns a new instance of Basic.



20
21
22
23
24
25
26
27
28
# File 'lib/routemaster/drain/basic.rb', line 20

def initialize(options = {})
  @terminator = terminator = Terminator.new
  @app = ::Rack::Builder.app do
    use Middleware::RootPostOnly
    use Middleware::Authenticate, options
    use Middleware::Parse
    run terminator
  end
end

Instance Method Details

#call(env) ⇒ Object

delegate :call => :@app



32
33
34
# File 'lib/routemaster/drain/basic.rb', line 32

def call(env)
  @app.call(env)
end