Permalink
Browse files

Add README

  • Loading branch information...
1 parent 64a984b commit 871ef96c6a89fa32f611f0b217f9715afeb514e5 @remiprev committed Apr 9, 2012
Showing with 36 additions and 0 deletions.
  1. +36 −0 README.md
View
@@ -0,0 +1,36 @@
+# Her
+
+[![Build Status](https://secure.travis-ci.org/remiprev/her.png)](http://travis-ci.org/remiprev/her)
+
+Her is an ORM (Object Relational Mapper) that maps REST resources to Ruby objects. It is designed to build applications that are powered by a RESTful API.
+
+## Installation
+
+In your Gemfile, add:
+
+ gem "her"
+
+## Usage
+
+To add the ORM to a class, you just have to include `Her::Model` in it and define which API you want it to be bound to. For example, with Rails, you would define a `config/initializers/her.rb` file with this:
+
+```ruby
+$my_api = Her::API.new
+$my_api.setup :base_uri => "https://api.example.com"
+```
+
+And then, for each of your models:
+
+```ruby
+class User
+ include Her::Model
+ uses_api $my_api
+end
+```
+
+After that, using Her is very similar to many ActiveModel-like ORMs:
+
+```ruby
+User.all # => Fetches "https://api.example.com/users" and return an array of User objects
+User.find(1) # => Fetches "https://api.example.com/users/1" and return a User object
+```

0 comments on commit 871ef96

Please sign in to comment.