Class: Fabric::ClientStub

Inherits:
Object
  • Object
show all
Defined in:
lib/fabric/client_stub.rb

Direct Known Subclasses

EventHub, Orderer, Peer

Constant Summary collapse

VALID_OPTIONS_KEYS =
%i[channel_override timeout propagate_mask channel_args interceptors]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, creds, options = {}) ⇒ ClientStub

Returns a new instance of ClientStub.



7
8
9
10
11
12
13
14
15
# File 'lib/fabric/client_stub.rb', line 7

def initialize(host, creds, options = {})
  @host = host
  @logger = options[:logger]

  @creds = GRPC::Core::ChannelCredentials.new(creds) if creds.is_a?(String)
  @creds ||= :this_channel_is_insecure

  @options = options.slice(*VALID_OPTIONS_KEYS)
end

Instance Attribute Details

#credsObject (readonly)

Returns the value of attribute creds.



3
4
5
# File 'lib/fabric/client_stub.rb', line 3

def creds
  @creds
end

#hostObject (readonly)

Returns the value of attribute host.



3
4
5
# File 'lib/fabric/client_stub.rb', line 3

def host
  @host
end

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/fabric/client_stub.rb', line 3

def logger
  @logger
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/fabric/client_stub.rb', line 3

def options
  @options
end