Class: Immudb::Interceptor
- Inherits:
-
GRPC::ClientInterceptor
- Object
- GRPC::ClientInterceptor
- Immudb::Interceptor
- Defined in:
- lib/immudb/interceptor.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#inspect ⇒ Object
hide token.
- #request_response(request: nil, call: nil, method: nil, metadata: nil) ⇒ Object
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
15 16 17 |
# File 'lib/immudb/interceptor.rb', line 15 def token @token end |
Instance Method Details
#inspect ⇒ Object
hide token
27 28 29 |
# File 'lib/immudb/interceptor.rb', line 27 def inspect to_s end |
#request_response(request: nil, call: nil, method: nil, metadata: nil) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/immudb/interceptor.rb', line 17 def request_response(request: nil, call: nil, method: nil, metadata: nil) ["authorization"] = "Bearer #{token}" if token begin super rescue GRPC::Unknown => e raise Error, e.details end end |