Class: Vvm::CLI::Command::ShowCoins

Inherits:
Base
  • Object
show all
Defined in:
lib/vvm/cli/command/insert_coin.rb

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

by_command_name, inherited, #initialize

Constructor Details

This class inherits a constructor from Vvm::CLI::Command::Base

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vvm/cli/command/insert_coin.rb', line 9

def call
  result = prompt.slider(
    'Coin',
    [0.25, 0.50, 1.00, 2.00, 5.00, 10.00, 50.00, 100.00],
    help: '(Move arrows left and right to set value)',
    format: ':slider $%.2f'
  )

  machine.insert(result)

  env.call(:show_main_menu)
end