README.md in acfs-0.2.0 vs README.md in acfs-0.3.0
- old
+ new
@@ -1,6 +1,6 @@
-# Acfs - *API Client for Services*
+# Acfs - *API client for services*
[![Gem Version](https://badge.fury.io/rb/acfs.png)](http://badge.fury.io/rb/acfs) [![Build Status](https://travis-ci.org/jgraichen/acfs.png?branch=master)](https://travis-ci.org/jgraichen/acfs) [![Coverage Status](https://coveralls.io/repos/jgraichen/acfs/badge.png?branch=master)](https://coveralls.io/r/jgraichen/acfs) [![Code Climate](https://codeclimate.com/github/jgraichen/acfs.png)](https://codeclimate.com/github/jgraichen/acfs) [![Dependency Status](https://gemnasium.com/jgraichen/acfs.png)](https://gemnasium.com/jgraichen/acfs)
TODO: Develop asynchronous parallel API client library for service oriented applications.
@@ -8,29 +8,30 @@
## Installation
Add this line to your application's Gemfile:
- gem 'acfs'
+ gem 'acfs', '0.3.0'
+**Note:** Acfs is under development. API may change anytime. No semantic versioning until version `1.0`. Version `1.0`
+does not mean complete feature set but stable basic code base.
+
And then execute:
$ bundle
Or install it yourself as:
$ gem install acfs
## Usage
-TODO: Write usage instructions here
+### Attributes
-### Acfs::Attributes
-
```ruby
class MyModel
- include Acfs::Attributes
+ include Acfs::Model
attribute :name, :string
attribute :age, :integer, default: 15
end
@@ -39,16 +40,47 @@
mo = MyModel.new name: 'Johnny', age: 12
mo.name # => "Johnny"
mo.age = '13'
mo.age # => 13
mo.attributes # => { "name" => "Johnny", "age" => 13 }
+```
+### Service, Model & Collection
+
+```ruby
+class MyService < Acfs::Service
+ self.base_url = 'http://acc.srv'
+end
+
+class User
+ include Acfs::Model
+ service MyService
+
+ attribute :id, :integer
+end
+
+@user = User.find 14
+
+@user.loaded? #=> false
+
+Acfs.run # This will run all queued request as parallel as possible.
+ # For @user the following URL will be requested:
+ # `http://acc.srv/users/14`
+
+@model.name # => "..."
+
+@users = User.all
+@users.loaded? #=> false
+
+Acfs.run # Will request `http://acc.srv/users`
+
+@users #=> [<User>, ...]
```
## TODO
-* Library Code
+* Develop Library
* Documentation
## Contributing
1. Fork it
@@ -56,5 +88,11 @@
3. Add specs for your feature
4. Implement your feature
5. Commit your changes (`git commit -am 'Add some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create new Pull Request
+
+## License
+
+MIT License
+
+Copyright (c) 2013 Jan Graichen. MIT license, see LICENSE for more details.