Class: Fabric::Gateway

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

Overview

Gateway represents the connection of a specific client identity to a Fabric Gateway.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signer, client) ⇒ Gateway

Initialize a new Gateway

Parameters:

Raises:



16
17
18
19
20
21
22
# File 'lib/fabric/gateway.rb', line 16

def initialize(signer, client)
  raise InvalidArgument, 'signer must be Fabric::Identity' unless signer.is_a? Fabric::Identity
  raise InvalidArgument, 'client must be Fabric::Client' unless client.is_a? Fabric::Client

  @signer = signer
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



8
9
10
# File 'lib/fabric/gateway.rb', line 8

def client
  @client
end

#signerObject (readonly)

Returns the value of attribute signer.



8
9
10
# File 'lib/fabric/gateway.rb', line 8

def signer
  @signer
end

Instance Method Details

#new_network(name) ⇒ Fabric::Network

Initialize new network from the Gateway

Parameters:

  • name (string)

    channel name

Returns:



31
32
33
# File 'lib/fabric/gateway.rb', line 31

def new_network(name)
  Network.new(self, name)
end