Class: Razrbit::Markets

Inherits:
HTTP
  • Object
show all
Defined in:
lib/razrbit/markets.rb

Instance Attribute Summary

Attributes inherited from HTTP

#app_id, #app_secret

Instance Method Summary collapse

Methods inherited from HTTP

#initialize

Constructor Details

This class inherits a constructor from Razrbit::HTTP

Instance Method Details

#day_price(currency_code: nil) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/razrbit/markets.rb', line 15

def day_price(currency_code: nil)
  uri = create_uri 'markets/dayPrice'

  form_data = {
    'currencyCode' => currency_code
  }

  post(uri, form_data)
end

#historical_price(currency_code: nil, date: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/razrbit/markets.rb', line 25

def historical_price(currency_code: nil, date: nil)
  uri = create_uri 'markets/historicalPrice'

  form_data = {
    'currencyCode' => currency_code,
    'date' => date
  }

  post(uri, form_data)
end

#price(currency_code: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/razrbit/markets.rb', line 5

def price(currency_code: nil)
  uri = create_uri 'markets/price'

  form_data = {
    'currencyCode' => currency_code
  }

  post(uri, form_data)
end