Class: ArkEcosystem::Client::API::Delegates

Inherits:
Base
  • Object
show all
Defined in:
lib/arkecosystem/client/api/delegates.rb

Overview

Methods for the Delegates API

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ArkEcosystem::Client::API::Base

Instance Method Details

#all(parameters = {}) ⇒ Faraday::Response

Get all delegates.

Parameters:

  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


13
14
15
# File 'lib/arkecosystem/client/api/delegates.rb', line 13

def all(parameters = {})
  @client.get('delegates', parameters)
end

#blocks(id, parameters = {}) ⇒ Faraday::Response

Get the blocks for the given delegate.

Parameters:

  • id (String)
  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


32
33
34
# File 'lib/arkecosystem/client/api/delegates.rb', line 32

def blocks(id, parameters = {})
  @client.get("delegates/#{id}/blocks", parameters)
end

#show(id) ⇒ Faraday::Response

Get the delegate by the given id.

Parameters:

  • id (String)

Returns:

  • (Faraday::Response)


22
23
24
# File 'lib/arkecosystem/client/api/delegates.rb', line 22

def show(id)
  @client.get("delegates/#{id}")
end

#voters(id, parameters = {}) ⇒ Faraday::Response

Get the votes for the given delegate.

Parameters:

  • id (String)
  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)


42
43
44
# File 'lib/arkecosystem/client/api/delegates.rb', line 42

def voters(id, parameters = {})
  @client.get("delegates/#{id}/voters", parameters)
end