Giter Site home page Giter Site logo

takeaway-challenge's Introduction

Takeaway Challenge

Solution to the Makers Takeaway Challenge - original spec: https://github.com/makersacademy/takeaway-challenge

Approach

This solution is written in Ruby, and designed to be run in IRB.

Context

This program imitates a takeaway restaurant dealing with orders from a customer, and sending them a confirmation message when they place an order.

This program is intended to be used in irb.

instructions

In this program you'll need to explicitly create instances of Shop and Order classes.

The Shop class has a show_menu method to allow users to look at available meals. The add_to_order method takes 3 arguments - the order you've created, the item as a string, and the quantity (optional - defaults to 1). This will update details on the order.

The Order class has the show_summary method to show users the details of their order, and place_order to confirm the order.

The place_order method creates a new instance of a Messenger class and attempts to send a message to a user. To do this you'll need to have 4 environment variables:

  • A Twilio account SID
  • A Twilio authentication token
  • A Twilio number to send messages from
  • A verified number to receive messages to

Next steps

There's still some things left to be done on this project, time-permitting, including:

  • a method to remove/reduce items from orders
  • refactoring
  • more robust testing on the messenger.rb file
  • more robust way to check order totals are correct, and raise errors if not

takeaway-challenge's People

Contributors

anitacanita avatar dbugsy avatar dearshrewdwit avatar katerina-codes avatar mateowh avatar neoeno avatar ptolemybarnes avatar roidriscoll avatar sdorunga avatar silvabox avatar tansaku 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.