README.md in rapidash-0.3.0 vs README.md in rapidash-0.3.1

- old
+ new

@@ -1,9 +1,7 @@ -# Rapidash [![Build Status](https://travis-ci.org/Gazler/rapidash.png?branch=master)](https://travis-ci.org/Gazler/rapidash) +# Rapidash [![Build Status](https://travis-ci.org/Gazler/rapidash.png?branch=master)](https://travis-ci.org/Gazler/rapidash) [![Coverage Status](https://coveralls.io/repos/Gazler/rapidash/badge.png?branch=master)](https://coveralls.io/r/Gazler/rapidash?branch=master) -![Rapidash](http://rapidashgem.com/images/rapidash.png) - Rapidash is a core for you to build a client for your API on. The goal is to define a standard way that developers can quickly write a client for the consumption of their RESTful API. ## Installation Add this line to your application's Gemfile: @@ -91,10 +89,33 @@ class AnotherResource < Rapidash::Base resource :my_cool_resource, :class_name => "MyModule::MyResource" end ``` + +### Collections + +The collection method allows you to add methods to a resource. + +```ruby +class Project < Rapidash::Base + collection :archived +end + +# creates the method below which performs a +# GET /projects/archived +client.projects.archived! + +class Project < Rapidash::Base + collection :delete_all, path: 'destroy', method: :post +end + +# creates the method below which performs a +# POST /projects/destroy +client.projects.delete_all! +``` + ### Client The main thing a client must do is define a method, `oauth` and `http` are currently supported. You can also define resources which links a resource as defined above to the client. ```ruby @@ -155,10 +176,11 @@ ```ruby require 'rapidash' class Repo < Rapidash::Base +end class User < Rapidash::Base resource :repos end @@ -195,9 +217,5 @@ 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Write your tests, start and check coverage: open file coverage/index.html in your browser. Must be 100.0% covered 5. Push to the branch (`git push origin my-new-feature`) 6. Create new Pull Request (into the development branch) - -## Credits - -Thanks to [@Sid3show](https://github.com/Sid3show) for the sweet logo!