./README.md in sinatra-param-1.1.2 vs ./README.md in sinatra-param-1.2.0
- old
+ new
@@ -31,10 +31,11 @@
get '/search' do
param :q, String, required: true
param :categories, Array
param :sort, String, default: "title"
param :order, String, in: ["ASC", "DESC"], transform: :upcase, default: "ASC"
+ param :price, String, format: "[<\=>]\s*\$\d+"
{...}.to_json
end
end
```
@@ -57,9 +58,10 @@
- `required`
- `blank`
- `is`
- `in`, `within`, `range`
- `min` / `max`
+- `format`
### Defaults and Transformations
Passing a `default` option will provide a default value for a parameter if none is passed. A `default` can defined as either a default or as a `Proc`: