Class: Lnrpc::MacaroonInterceptor
- Inherits:
-
GRPC::ClientInterceptor
- Object
- GRPC::ClientInterceptor
- Lnrpc::MacaroonInterceptor
- Defined in:
- lib/lnrpc/macaroon_interceptor.rb
Instance Method Summary collapse
-
#initialize(macaroon_hex) ⇒ MacaroonInterceptor
constructor
A new instance of MacaroonInterceptor.
- #inject_macaroon_metadata(request:, call:, method:, metadata:) ⇒ Object (also: #request_response, #client_streamer, #server_streamer, #bidi_streamer)
Constructor Details
#initialize(macaroon_hex) ⇒ MacaroonInterceptor
Returns a new instance of MacaroonInterceptor.
5 6 7 |
# File 'lib/lnrpc/macaroon_interceptor.rb', line 5 def initialize(macaroon_hex) @macaroon = macaroon_hex end |
Instance Method Details
#inject_macaroon_metadata(request:, call:, method:, metadata:) ⇒ Object Also known as: request_response, client_streamer, server_streamer, bidi_streamer
9 10 11 12 13 14 |
# File 'lib/lnrpc/macaroon_interceptor.rb', line 9 def (request:, call:, method:, metadata:) if !.has_key?('macaroon') && !.has_key?(:macaroon) [:macaroon] = @macaroon end yield end |