class Coinpare::CLI
Handle the application command line parsing and the dispatch to various command objects
@api public
Constants
- Error
Error
raised by this runner
Public Instance Methods
coins(*names)
click to toggle source
# File lib/coinpare/cli.rb, line 60 def coins(*names) if options[:help] invoke :help, ["coins"] else require_relative "commands/coins" Coinpare::Commands::Coins.new(names, options).execute end end
help(*args)
click to toggle source
Calls superclass method
# File lib/coinpare/cli.rb, line 16 def help(*args) font = TTY::Font.new(:standard) pastel = Pastel.new(enabled: !options["no-color"]) puts pastel.yellow(font.write("Coinpare")) super end
holdings(*)
click to toggle source
# File lib/coinpare/cli.rb, line 106 def holdings(*) if options[:help] invoke :help, ["holdings"] else require_relative "commands/holdings" Coinpare::Commands::Holdings.new(options).execute end end
markets(name = "BTC")
click to toggle source
# File lib/coinpare/cli.rb, line 144 def markets(name = "BTC") if options[:help] invoke :help, ["markets"] else require_relative "commands/markets" Coinpare::Commands::Markets.new(name, options).execute end end
version()
click to toggle source
# File lib/coinpare/cli.rb, line 154 def version require_relative "version" puts "v#{Coinpare::VERSION}" end