vendingmachine exercise in Ruby