Skip to content

Commit

Permalink
Merge branch 'docsite-1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Oct 8, 2019
2 parents 15b92bc + e0f4eae commit 20e38f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions docsite/source/basics/macros.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Defining rules using blocks is very flexible and powerful; however, in most comm

This document describes available built-in macros.

### `value`
### value

Use it to quickly provide a list of all predicates that will be `AND`-ed automatically:

Expand All @@ -19,7 +19,7 @@ Dry::Schema.Params do
end
```

### `filled`
### filled

Use it when a value is expected to be filled. "filled" means that the value is non-nil and, in the case of a `String`, `Hash`, or `Array` value, that the value is not `.empty?`.

Expand All @@ -37,7 +37,7 @@ Dry::Schema.Params do
end
```

### `maybe`
### maybe

Use it when a value can be nil.

Expand All @@ -50,7 +50,7 @@ Dry::Schema.Params do
end
```

### `hash`
### hash

Use it when a value is expected to be a hash:

Expand All @@ -63,7 +63,7 @@ Dry::Schema.Params do
end
```

### `schema`
### schema

This works like `hash` but does not prepend `hash?` predicate. It's a simpler building block for checking nested hashes. Use it when *you* want to provide base checks prior applying rules to values.

Expand All @@ -76,7 +76,7 @@ Dry::Schema.Params do
end
```

### `array`
### array

Use it to apply predicates to every element in a value that is expected to be an array.

Expand All @@ -98,7 +98,7 @@ Dry::Schema.Params do
end
```

### `each`
### each

This works like `array` but does not prepend `array?` predicate. It's a simpler building block for checking each element of an array. Use it when *you* want to provide base checks prior applying rules to elements.

Expand All @@ -113,4 +113,4 @@ end

- [Type specs](/gems/dry-schema/basics/type-specs)
- [Built-in predicates](/gems/dry-schema/basics/built-in-predicates)
- [Working with schemas](/gems/dry-schema/basics/working-with-schemas)
- [Working with schemas](/gems/dry-schema/basics/working-with-schemas)
8 changes: 4 additions & 4 deletions docsite/source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Main focus of this library is on:

There are a few features of `dry-schema` that make it unique:

* [Structural validation](/gems/dry-schema/optional-keys-and-values) where key presence can be verified separately from values. This removes ambiguity related to "presence" validation where you don't know if value is indeed `nil` or if a key is missing in the input hash
* [Pre-coercion validation using filtering rules](/gems/dry-schema/advanced/filtering)
* [Structural validation](docs::optional-keys-and-values) where key presence can be verified separately from values. This removes ambiguity related to "presence" validation where you don't know if value is indeed `nil` or if a key is missing in the input hash
* [Pre-coercion validation using filtering rules](docs::advanced/filtering)
* Explicit coercion logic - rather than implementing complex generic coercions, `dry-schema` uses coercion types from `dry-types` which are faster and more strict than generic coercions
* Support for [validating array elements](/gems/dry-schema/basics/macros#array) with convenient access to error messages
* Powerful introspection - you have access to [key maps](/gems/dry-schema/advanced/key-maps) and detailed [Rule AST](/gems/dry-schema/advanced/rule-ast)
* Support for [validating array elements](docs::basics/macros#array) with convenient access to error messages
* Powerful introspection - you have access to [key maps](docs::advanced/key-maps) and detailed [Rule AST](docs::advanced/rule-ast)
* Performance - multiple times faster than validations based on `ActiveModel` and `strong parameters`
* Configurable, localized error messages with or *without* `I18n` gem

Expand Down

0 comments on commit 20e38f4

Please sign in to comment.