class ArkEcosystem::Client::Connection

The connection used to communicate with the API.

Attributes

client[RW]

Public Class Methods

new(config, client = nil) click to toggle source

Create a new connection instance.

@param config [Hash]

@return [ArkEcosystem::Client::Connection]

# File lib/arkecosystem/client/connection.rb, line 21
def initialize(config, client = nil)
  @host = config[:host]

  raise ArgumentError, 'No API host is provided.' if @host.nil?

  if client.nil? # rubocop:disable Style/ConditionalAssignment
    @client = ArkEcosystem::Client::HTTP::Client.new(config)
  else
    @client = client.new(config)
  end
end

Public Instance Methods

blocks() click to toggle source

Return the Blocks API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 36
def blocks
  @blocks ||= ArkEcosystem::Client::API::Blocks.new(@client)
end
delegates() click to toggle source

Return the Delegates API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 43
def delegates
  @delegates ||= ArkEcosystem::Client::API::Delegates.new(@client)
end
node() click to toggle source

Return the Node API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 50
def node
  @node ||= ArkEcosystem::Client::API::Node.new(@client)
end
peers() click to toggle source

Return the Peers API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 57
def peers
  @peers ||= ArkEcosystem::Client::API::Peers.new(@client)
end
transactions() click to toggle source

Return the Transactions API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 64
def transactions
  @transactions ||= ArkEcosystem::Client::API::Transactions.new(@client) # rubocop:disable Metrics/LineLength
end
votes() click to toggle source

Return the Votes API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 71
def votes
  @votes ||= ArkEcosystem::Client::API::Votes.new(@client)
end
wallets() click to toggle source

Return the Wallets API resource.

@return [Object]

# File lib/arkecosystem/client/connection.rb, line 78
def wallets
  @wallets ||= ArkEcosystem::Client::API::Wallets.new(@client)
end