class ArkEcosystem::Client::ConnectionManager
Manager that holds all connections
Attributes
connections[RW]
default[RW]
Public Class Methods
new()
click to toggle source
Create a new client instance.
@return [Faraday::Response]
# File lib/arkecosystem/client/connection_manager.rb, line 14 def initialize @default = 'main' @connections = {} end
Public Instance Methods
connect(connection, name = 'main')
click to toggle source
Connection
to the given connection.
@param connection [ArkEcosystem::Client::Connection] @param name [String]
@return [Faraday::Response]
# File lib/arkecosystem/client/connection_manager.rb, line 25 def connect(connection, name = 'main') @connections[name] = connection end
connection(name)
click to toggle source
Get a connection instance.
@param name [String]
@return [ArkEcosystem::Client::Connection]
# File lib/arkecosystem/client/connection_manager.rb, line 43 def connection(name) @connections[name] end
disconnect(name)
click to toggle source
Disconnect from the given connection.
@param name [String]
@return [nil]
# File lib/arkecosystem/client/connection_manager.rb, line 34 def disconnect(name) @connections.delete(name) end