Coder Social home page Coder Social logo

takeaway's Introduction

#Takeaway ##Makers Academy Week 4 Test, Part II

###Aim

The aim was to write a class Takeaway with the following functionality:

  • print a list of dishes with prices

  • a customer can place an order by giving a list of dishes, their quantities, and a number that should be the exact total cost of the order

  • if the order total is not correct, an error should be raised

  • if it is correct, a text should be delievered to the customer's phone confirming their order and saying that it will be delivered within the next hour.

###Other details

The test was set by Enrique Comba Riepenhausen, @ecomba

The format for placing orders is as follows:

customer.place_order_at takeaway, {'dish1' => quantity, 'dish2 => quantity}, order_total

The Twilio API was used to implement the SMS functionality.

###To do

  • Refine method names to make them clearer, e.g. Takeaway#confirmation_message instead of Takeaway#message
  • Split the functionality out into more classes, which would enable more scope for development. Possible classes include: Dish, Menu, Order, LineItem, TwilioOrder (initialised with a TwilioWrapper)
  • Disguise Twilio details under ENV variables

takeaway's People

Contributors

nodunayo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.