Class: Exrt::Cli::CLI

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

Instance Method Summary collapse

Instance Method Details

#historyObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/exrt/cli.rb', line 24

def history
  base = options["base"]
  symbols = options["symbols"]
  response = Exrt::Rate.history(
    base: base,
    symbols: symbols,
    start_at: options["start_at"],
    end_at: options["end_at"]
  )
  r = Exrt::Cli::Renderer.new(d: response, t: Exrt::Cli::HISTORY)
  puts r.render
end

#latestObject



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

def latest
  base = options["base"]
  symbols = options["symbols"]
  response = Exrt::Rate.latest(base: base, symbols: symbols)
  r = Exrt::Cli::Renderer.new(d: response, t: Exrt::Cli::LATEST)
  puts r.render
end