GithubHelp home page GithubHelp logo

borisbikes's Introduction

Makers Academy Week 1 Challenge: Boris Bikes Challenge

An introductory project to cover the basics of Test Driven Development and Object Oriented Programming. A basic ruby app that handles the docking and undocking of Boris Bikes from a docking station.

Installation

  • Clone this repo
  • In the project root, run bundle install
  • To run the tests, run rspec
  • To try the app, run irb then follow the usage example below

Usage

>> require './lib/bike.rb'
>> require './lib/dockingstation.rb'
>> Bike1 = Bike.new
=> #<Bike:0x0000000215f818>
>> Bike2 = Bike.new
=> #<Bike:0x0000000215c8c0>
>> Bike3 = Bike.new
=> #<Bike:0x00000002159878>
>> DStation = DockingStation.new
=> #<DockingStation:0x000000021491a8 @docked_bikes=[], @capacity=20>
>> DStation.dock(Bike1)
=> [#<Bike:0x0000000215f818>]
>> DStation.dock(Bike2)
=> [#<Bike:0x0000000215f818>, #<Bike:0x0000000215c8c0>]
>> DStation.dock(Bike3)
=> [#<Bike:0x0000000215f818>, #<Bike:0x0000000215c8c0>, #<Bike:0x00000002159878>]
>> DStation.release_bike
=> #<Bike:0x00000002159878>
>> DStation.docked_bikes
=> [#<Bike:0x0000000215f818>, #<Bike:0x0000000215c8c0>]
>> DStation.release_bike
=> #<Bike:0x0000000215c8c0>
>> DStation.docked_bikes
=> [#<Bike:0x0000000215f818>]
>> DStation.release_bike
=> #<Bike:0x0000000215f818>
>> DStation.docked_bikes
=> []
>> DStation.release_bike
RuntimeError: There are no docked bikes!
	from /home/rick/web/borisbikes/lib/dockingstation.rb:12:in `release_bike'
	from (irb):18
	from /usr/share/rvm/rubies/ruby-2.3.3/bin/irb:11:in `<main>'
>> 

borisbikes's People

Contributors

rkclark avatar bwk103 avatar shezdev avatar

Watchers

James Cloos avatar  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.