readme.md

BikeShare

A Ruby gem for interacting with Bay Area Bike Share stations and bike info

  • Ongoing Bike safety, lanes, and infrastructure efforts by Patrick Traughber and friends.

Installation

gem install bikeshare

Returns the full JSON of stations available and their information

response.last_station_id

Will return an integer of the last station in the system

response.station_info(2)

Takes a station_id as an integer, returns an hash with that station's info

response.stations("San Francisco")

Takes a city name string such as "San Francisco" and returns an array of all the stations in that municipality

response.empty_stations
response.empty?(2)

Takes a station_id as an integer and retuns true or false based on the number of availableBikes

response.full?(2)

Takes a station_id as an integer and retuns true or false based on the number of availableBikes and total docks at that station.

response.available_bikes(2)

Takes a station_id as an integer and returns the nunber of available bikes

response.total_docks(2)

Takes a station_id as an integer and returns the total number of docks at that station

response.percent_available(2)

Takes a station_id as an integer and returns the percentage of bikes available, rounded two decimal places

response.offline_stations

Returns an array of stations currently offline

  • If you would like to contribute, fork this repo, create a new branch with your changes and submit a pull request!

  • If you have any questions, I'm @ZackShapiro on Twitter.

Bikeshare is open source, and made available under the MIT License. Distribute, use as-is, or modify to your liking in personal and commercial projects.