Class: GRPC::Core::CompositeChannelCredentials
- Inherits:
-
Object
- Object
- GRPC::Core::CompositeChannelCredentials
- Defined in:
- src/ruby/lib/grpc/core/channel_credentials.rb
Instance Attribute Summary collapse
-
#call_credentials ⇒ Object
readonly
Returns the value of attribute call_credentials.
-
#channel_credentials ⇒ Object
readonly
Returns the value of attribute channel_credentials.
Instance Method Summary collapse
- #compose(*others) ⇒ Object
-
#initialize(channel_creds, call_creds) ⇒ CompositeChannelCredentials
constructor
A new instance of CompositeChannelCredentials.
Constructor Details
#initialize(channel_creds, call_creds) ⇒ CompositeChannelCredentials
Returns a new instance of CompositeChannelCredentials.
47 48 49 50 |
# File 'src/ruby/lib/grpc/core/channel_credentials.rb', line 47 def initialize(channel_creds, call_creds) @channel_credentials = channel_creds @call_credentials = call_creds end |
Instance Attribute Details
#call_credentials ⇒ Object (readonly)
Returns the value of attribute call_credentials.
45 46 47 |
# File 'src/ruby/lib/grpc/core/channel_credentials.rb', line 45 def call_credentials @call_credentials end |
#channel_credentials ⇒ Object (readonly)
Returns the value of attribute channel_credentials.
45 46 47 |
# File 'src/ruby/lib/grpc/core/channel_credentials.rb', line 45 def channel_credentials @channel_credentials end |
Instance Method Details
#compose(*others) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'src/ruby/lib/grpc/core/channel_credentials.rb', line 52 def compose(*others) return self if others.empty? flat_others = others.flatten flat_others.each do |o| fail TypeError, "Argument to compose must be a CallCredentials, got #{o.class}" \ unless o.is_a?(CallCredentials) end if @call_credentials CompositeChannelCredentials.new(@channel_credentials, @call_credentials.compose(*flat_others)) else CompositeChannelCredentials.new(@channel_credentials, CompositeCallCredentials.new(flat_others)) end end |