Class: Fabric::Gateway
- Inherits:
-
Object
- Object
- Fabric::Gateway
- Defined in:
- lib/fabric/gateway.rb
Overview
Gateway represents the connection of a specific client identity to a Fabric Gateway.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#signer ⇒ Object
readonly
Returns the value of attribute signer.
Instance Method Summary collapse
-
#initialize(signer, client) ⇒ Gateway
constructor
Initialize a new Gateway.
-
#new_network(name) ⇒ Fabric::Network
Initialize new network from the Gateway.
Constructor Details
#initialize(signer, client) ⇒ Gateway
Initialize a new Gateway
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/fabric/gateway.rb', line 8 def client @client end |
#signer ⇒ Object (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
31 32 33 |
# File 'lib/fabric/gateway.rb', line 31 def new_network(name) Network.new(self, name) end |