class CryptoMarket::CLI

Attributes

currencies[RW]

Public Class Methods

new() click to toggle source

Initialize the CLI with an instance of all currencies

# File lib/crypto_market/cli.rb, line 6
def initialize
  @currencies = CryptoMarket::Currencies.new
end

Public Instance Methods

enter_input_msg() click to toggle source
# File lib/crypto_market/cli.rb, line 30
def enter_input_msg
  print 'Enter a number: '
end
enter_valid_input_msg() click to toggle source
# File lib/crypto_market/cli.rb, line 26
def enter_valid_input_msg
  puts 'Enter a correct number from the list'
end
greeting() click to toggle source

Greeting message

# File lib/crypto_market/cli.rb, line 18
  def greeting
    <<-DOC
Welcome to the Crypto Market
All the prices are updated every 5 minutes
Enter a number to navigate
    DOC
  end
navigation() click to toggle source

User navigation

run() click to toggle source

Run command to start the program

# File lib/crypto_market/cli.rb, line 11
def run
  currencies.run
  puts ascii_welcome
  navigation
end