Class: Exrt::Rate

Inherits:
Object
  • Object
show all
Defined in:
lib/exrt.rb

Class Method Summary collapse

Class Method Details

.history(base: "USD", symbols: [], start_at:, end_at:) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/exrt.rb', line 12

def self.history(base: "USD", symbols: [], start_at:, end_at:)
  response = Exrt::Http.get("/history", {
    base: base,
    symbols: symbols_str(symbols),
    start_at: start_at,
    end_at: end_at,
  })
  to_json(response.body)
end

.latest(base: "USD", symbols: []) ⇒ Object



7
8
9
10
# File 'lib/exrt.rb', line 7

def self.latest(base: "USD", symbols: [])
  response = Exrt::Http.get("/latest", { base: base, symbols: symbols_str(symbols) })
  to_json(response.body)
end