class Chid::Commands::Currency::Current

Public Instance Methods

from() click to toggle source
# File lib/chid/commands/currency/now.rb, line 40
def from
  options['-from']&.compact&.join || 'USD'
end
run() click to toggle source
# File lib/chid/commands/currency/now.rb, line 31
def run
  currency = CurrencyApi.convert(to: to, from: from)
  puts "1 #{from} is #{currency} #{to}"
end
to() click to toggle source
# File lib/chid/commands/currency/now.rb, line 36
def to
  options['-to']&.compact&.join || 'BRL'
end