README.md in citybikes_api-2.0.0 vs README.md in citybikes_api-2.0.1

- old
+ new

@@ -1,9 +1,10 @@ -# CitybikesApi - Ruby +# CityBikes API - Ruby :bike: :bike: :bike: -A ruby interface to the [CityBikes API](http://api.citybik.es/v2/) (v2). - Includes endpoints for bike-share network and station data. +A ruby interface to the [CityBikes API](http://api.citybik.es/v2/) v2. + Returns data about bike-share networks and stations. + Includes options to customize API requests. [![Gem Version](https://badge.fury.io/rb/citybikes_api.svg)](https://badge.fury.io/rb/citybikes_api) ## Installation @@ -13,23 +14,48 @@ gem install citybikes_api ```` ## Usage -Get a list of all bike-share networks. +### Requests +#### Networks Endpoint + +List all bike-share networks. + ```` rb response = CitybikesApi.networks -puts response["networks"] +puts response["networks"] #=> returns an Array of Hash objects ```` -Find a given bike-share network and all of its stations. +#### Network Endpoint +Find a bike-share network by its CityBikes identifier. + ```` rb +network_id = "capital-bikeshare" response = CitybikesApi.network(network_id) -puts response["network"] -puts response["network"]["stations"] +puts response["network"] #=> returns a Hash object ```` + +### Request Options + +Customize any network request by passing URL parameters. + +```` rb +request_options = {:fields => "id,name,href"} +response = CitybikesApi.networks(request_options) +puts response["networks"] #=> returns an Array of Hash objects, each of which should only contain the requested fields/attributes +```` + +```` rb +network_id = "capital-bikeshare" +request_options = {:fields => "id,name,href"} +response = CitybikesApi.network(network_id, request_options) +puts response["network"] #=> returns a Hash object which should only contain the requested fields/attributes +```` + +See [CityBikes documentation](http://api.citybik.es/v2/#Syntax) for more info about field-filtering. ## Contributing Browse existing [issues](https://github.com/data-creative/citybikes-api-ruby/issues) or create a new issue to communicate bugs, desired features, etc.