Class: GRPC::Core::CallCredentials
- Inherits:
-
Object
- Object
- GRPC::Core::CallCredentials
- Defined in:
- src/ruby/lib/grpc/core/call_credentials.rb
Overview
CallCredentials represents per-call credentials.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#auth_proc ⇒ Object
readonly
Returns the value of attribute auth_proc.
Instance Method Summary collapse
- #compose(*others) ⇒ Object
- #composite? ⇒ Boolean
- #get_metadata(context) ⇒ Object
-
#initialize(auth_proc = nil, &block) ⇒ CallCredentials
constructor
A new instance of CallCredentials.
Constructor Details
#initialize(auth_proc = nil, &block) ⇒ CallCredentials
Returns a new instance of CallCredentials.
23 24 25 26 |
# File 'src/ruby/lib/grpc/core/call_credentials.rb', line 23 def initialize(auth_proc = nil, &block) @auth_proc = auth_proc || block fail TypeError, 'Argument to CallCredentials#new must be a proc' unless @auth_proc.is_a?(Proc) end |
Instance Attribute Details
#auth_proc ⇒ Object (readonly)
Returns the value of attribute auth_proc.
21 22 23 |
# File 'src/ruby/lib/grpc/core/call_credentials.rb', line 21 def auth_proc @auth_proc end |
Instance Method Details
#compose(*others) ⇒ Object
36 37 38 39 40 |
# File 'src/ruby/lib/grpc/core/call_credentials.rb', line 36 def compose(*others) return self if others.empty? valid_others = validate_credentials_list!(others) CompositeCallCredentials.new([self] + valid_others) end |
#composite? ⇒ Boolean
32 33 34 |
# File 'src/ruby/lib/grpc/core/call_credentials.rb', line 32 def composite? false end |
#get_metadata(context) ⇒ Object
28 29 30 |
# File 'src/ruby/lib/grpc/core/call_credentials.rb', line 28 def (context) @auth_proc.call(context) end |