Class: Hodlmoon::Cli

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

Constant Summary collapse

DEFAULT_LIMIT =
8
CURRENCY =
{
  gbp: '£',
  usd: '$',
  eur: ''
}.freeze

Instance Method Summary collapse

Instance Method Details

#hello(name) ⇒ Object



17
18
19
# File 'lib/hodlmoon/cli.rb', line 17

def hello(name)
  puts "Hello #{name}"
end

#list(limit = DEFAULT_LIMIT, currency = 'gbp') ⇒ Object



28
29
30
31
# File 'lib/hodlmoon/cli.rb', line 28

def list(limit = DEFAULT_LIMIT, currency = 'gbp')
  info = Hodlmoon::Client::RetrieveList.call(limit, currency)
  puts Hodlmoon::Table.build(info, currency)
end

#price(coin, currency = 'gbp') ⇒ Object



22
23
24
25
# File 'lib/hodlmoon/cli.rb', line 22

def price(coin, currency = 'gbp')
  info = Hodlmoon::Client::RetrievePrice.call(coin, currency)
  puts Hodlmoon::Table.build(info, currency)
end