class MoneyExchange::Command

Public Instance Methods

banner() click to toggle source
c(str, d='32') click to toggle source
# File lib/money_exchange/command.rb, line 26
def c(str, d='32')
  "\e[#{d}m#{str}\e[0m"
end
ex(amount, base, *targets) click to toggle source
# File lib/money_exchange/command.rb, line 6
def ex(amount, base, *targets)
  results = amount.send("#{base.downcase}_to", *targets.map(&:downcase))
  print_in_format(amount, base, targets, results)
rescue Exchange::NoCurrencyDataError
  abort "no exchange data for any of them. see help."
rescue
  abort "you might pass wrong codes. see help."
end
print_in_format(amount, base, targets, results) click to toggle source
version() click to toggle source
# File lib/money_exchange/command.rb, line 32
def version
  puts "MoneyExchange #{MoneyExchange::VERSION} (c) 2013 kyoendo"
end