Git Product home page Git Product logo

boris-bikes's Introduction

##Boris Bikes

About

The challenge for week 1 of Makers Academy was to model the Boris Bikes cycle hire system. This was done using Ruby, and test driven with RSpec.

Installation

  1. Clone this repo using $ git clone [email protected]:Wynndow/Boris-Bikes.git
  2. Move into the new directory using $ cd Boris-Bikes

Usage

[1] pry(main)> load './lib/dockingstation.rb'
=> true
[2] pry(main)> docking_station = DockingStation.new
=> #<DockingStation:0x007f966d071a10 @bikes=[], @broken_bikes=[], @capacity=20>
[3] pry(main)> docking_station.release_bike
RuntimeError: Can't release bike: None available or broken
from /Users/chriswynne/Projects/Week1/Boris-Bikes/lib/dockingstation.rb:16:in `release_bike'
[4] pry(main)> bike = Bike.new
=> #<Bike:0x007f966a7dddd8 @working=true>
[5] pry(main)> docking_station.dock(bike)
=> [#<Bike:0x007f966a7dddd8 @working=true>]
[6] pry(main)> docking_station.release_bike
=> #<Bike:0x007f966a7dddd8 @working=true>
[7] pry(main)> broken_bike = Bike.new
=> #<Bike:0x007f966a705280 @working=true>
[8] pry(main)> broken_bike.report_broken
=> false
[9] pry(main)> docking_station.dock(broken_bike)
=> [#<Bike:0x007f966a705280 @working=false>]

Running tests

  1. Tests are run form the command line using $ rspec

boris-bikes's People

Contributors

wynndow avatar jborrell avatar

Watchers

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