Class: SynapsePayRest::CryptoQuotes

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse_pay_rest/api/crypto_quotes.rb

Overview

Wrapper class for /client endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CryptoQuotes

Returns a new instance of CryptoQuotes.

Parameters:



10
11
12
# File 'lib/synapse_pay_rest/api/crypto_quotes.rb', line 10

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientSynapsePayRest::HTTPClient



7
8
9
# File 'lib/synapse_pay_rest/api/crypto_quotes.rb', line 7

def client
  @client
end

Instance Method Details

#getHash

Sends a GET request to /crypto-quotes endpoint to get btc exchange rate and returns the response.

HTTP response from API

Parameters:

  • scope (String)

Returns:

  • (Hash)

    API response

Raises:



23
24
25
26
# File 'lib/synapse_pay_rest/api/crypto_quotes.rb', line 23

def get()
  path = '/nodes/crypto-quotes'
  client.get(path)
end