Module: Thrift::Middleware

Defined in:
lib/thrift/middleware.rb

Defined Under Namespace

Classes: MultiMiddleware, NopMiddleware

Constant Summary collapse

NOP_MIDDLEWARE =
NopMiddleware.new

Class Method Summary collapse

Class Method Details

.wrap(middlewares) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/thrift/middleware.rb', line 38

def wrap(middlewares)
  case middlewares.length
  when 0
    NOP_MIDDLEWARE
  when 1
    middlewares.first
  else
    MultiMiddleware.new(middlewares)
  end
end