Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ route do |r|
end
```

###Options
### Options

The plugin supports several options serialize, content_type, wrapper and id_pattern to modify processing of the request. Besides these, any number of custom options can be passed, which can be handy for the wrapper option.
Each option can be specified and overridden at the api, version or resource level.

####Serialization and content type
#### Serialization and content type

A serializer is an object that responds to :serialize and returns a string. Optionally it can provide the content_type, which may also be specified inline. Serialization can also be specified within a block inside the resource.

Expand Down Expand Up @@ -222,7 +222,7 @@ class App < Roda
end
```

####Wrapper
#### Wrapper

A wrapper module can be specified, containing one or more 'around_*' methods. These methods should yield with the passed arguments. Wrappers can be used for cleaning up incoming parameters, database transactions, authorization checking or serialization. A resource can hold a generic :resource option, that can be used for providing extra info to the wrapper. It can be useful to set a custom option like model_class on a resource when using wrappers.

Expand Down Expand Up @@ -277,7 +277,7 @@ class App < Roda
end
```

####ID pattern
#### ID pattern

To support various id formats a regex can be specified to match custom id formats.

Expand Down