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

Inherits:
Base
  • Object
show all
Defined in:
lib/arkecosystem/client/api/two/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)


17
18
19
# File 'lib/arkecosystem/client/api/two/delegates.rb', line 17

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)


36
37
38
# File 'lib/arkecosystem/client/api/two/delegates.rb', line 36

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)


26
27
28
# File 'lib/arkecosystem/client/api/two/delegates.rb', line 26

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)


46
47
48
# File 'lib/arkecosystem/client/api/two/delegates.rb', line 46

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