_________
r== | |
_ // | N.O.M | ))))
|_)//(''''': | |
// \_____:_____.-------D )))))
// | === | / \
.:'//. \ \=| \ / .:'':./ )))))
:' // ': \ \ ''..'--:'-.. ':
'. '' .' \:.....:--'.-'' .'
':..:' ':..:'
This program models a takeaway restaurant booking system. A user can:
- see a list of dishes with prices
- select some number of available dishes
- check that the total cost of dishes in their order
- receive a text to confirm the order cost and estimated delivery time
run:
$ pry
require './src/takeaway.rb'
An example walkthrough to place an order:
$ takeaway = Takeaway.new(Menu.new({ pizza: 10 }))
$ takeaway.new_order
$ order = takeaway.view_orders.last
$ order.add_to_basket(:pizza, 1)
$ order.view_basket
$ order.time
$ order.total
$ order.confirm(number)
This project requires the Twilio RubyGem (more info...).
You will need to create a file named api_keys.rb
at the project root directory with the following constants defined per your Twilio account:
ACCOUNT_SID = '****************'
AUTH_TOKEN = '****************'
FROM = '+44 0000 111 222'
TO = '+44 3333 444 555'
All other prerequisites are available by running the command $ bundle
.
You will need to run the command $ gem install bundle
if you don't have bundle already installed.
.
├── api_keys.rb
├── feature_test.rb
├── spec
│ ├── menu_spec.rb
│ ├── notification_spec.rb
│ ├── order_spec.rb
│ ├── spec_helper.rb
│ └── takeaway_spec.rb
└── src
├── menu.rb
├── notification.rb
├── order.rb
└── takeaway.rb
This program was built and tested using Test Driven Development