Class: ThriftServer::ValidationMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift_server/validation_middleware.rb

Instance Method Summary collapse

Instance Method Details

#call(rpc) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/thrift_server/validation_middleware.rb', line 5

def call(rpc)
  app.call(rpc).tap do |response|
    case response
    when Thrift::Struct, Thrift::Struct_Union
      Thrift::Validator.new.validate response
    end
  end
end