Program a model of a vending machine. It should at least satisfy the following requirements:
- Contains various products, each of which can be retrieved by entering in the correct amount of money, and punching in the code for that item
- Dispenses change after making a purchase
- Has a cancel button that returns the user's change
- Ability to stock/restock items in the machine
- Any other functionality that you think a vending machine should have!
It is not required that you build any sort of user interface, but there should be some demonstration of the model’s functionality. Write this code as if it were going into production.
- Using Contracts to show how typesafety and other concepts found in more "exotic" languages can be applied in ruby