README.md in conglomerate-0.10.0 vs README.md in conglomerate-0.11.0
- old
+ new
@@ -1,10 +1,9 @@
# Conglomerate
[![Gem Version](https://badge.fury.io/rb/conglomerate.png)](http://badge.fury.io/rb/conglomerate)
-[![Semaphore](https://semaphoreapp.com/api/v1/projects/7b914dac-6aa6-43dd-94a9-53698ef1922a/120842/shields_badge.png
-)](https://semaphoreapp.com/minter/conglomerate)
+[ ![Codeship Status for teamsnap/conglomerate](https://www.codeship.io/projects/7210a3f0-de00-0131-af05-5236ebb52643/status)](https://www.codeship.io/projects/24758)
[![Code Climate](https://codeclimate.com/github/teamsnap/conglomerate.png)](https://codeclimate.com/github/teamsnap/conglomerate)
[![Coverage Status](https://coveralls.io/repos/teamsnap/conglomerate/badge.png?branch=master)](https://coveralls.io/r/teamsnap/conglomerate?branch=master)
[![Dependency Status](https://gemnasium.com/teamsnap/conglomerate.png)](https://gemnasium.com/teamsnap/conglomerate)
[![License](http://img.shields.io/license/MIT.png?color=green)](http://opensource.org/licenses/MIT)
@@ -34,24 +33,33 @@
## Usage
```ruby
# Step 1: Create a serializer
class TeamSerializer
- include Conglomerate.serializer
+ include Conglomerate::RootBuilder
href { teams_url }
- item_href { |item| team_url(item.id) }
- attribute :id
- attribute :name, :template => true
- attribute :event_ids, :rel => :events { |item| event_url(item.event_ids.join(",")) }
+ item "Team" do |item|
+ href { team_url(item.id) }
- link :root { root_url }
+ datum :id
+ datum :name
+ datum :event_ids
- query :search, :data => :id { search_teams_url }
+ link :events, :href => Proc.new { event_url(item.event_ids.join(",")) }
+ end
- command :populate, :data => :id { populate_teams_url }
+ link :root, :href => Proc.new { root_url }
+
+ query :search, :href => Proc.new { search_items_url } do
+ datum :id
+ end
+
+ template do
+ datum :name
+ end
end
# Step 2: Serialize any object
class TeamsController < ApplicationController
@@ -100,18 +108,9 @@
],
"queries": [
{
"rel": "search",
"href": "http://example.com/teams/search",
- "data": [
- {"name": "id", "value": ""}
- ]
- }
- ],
- "commands": [
- {
- "rel": "populate",
- "href": "http://example.com/teams/populate",
"data": [
{"name": "id", "value": ""}
]
}
],