Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolab committed Mar 12, 2021
1 parent 483a23e commit 8690965
Show file tree
Hide file tree
Showing 16 changed files with 202 additions and 408 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Also [validator/check](#check) (not exposed by default) provides:
dependencies:
validator:
github: nicolab/crystal-validator
version: ~> 1.4.0 # Check the latest version!
version: ~> 1.5.0 # Check the latest version!
```
2. Run `shards install`
Expand Down
28 changes: 3 additions & 25 deletions docs/Check.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_version" content="master-dev">
<meta name="crystal_docs.project_name" content="validator">


Expand All @@ -13,7 +13,7 @@
<script type="text/javascript" src="js/doc.js"></script>

<meta name="repository-name" content="validator">
<title>Check - validator master</title>
<title>Check - validator master-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "";
</script>
Expand All @@ -39,7 +39,7 @@ <h1 class="project-name">
</h1>

<span class="project-version">
master
master-dev
</span>
</div>
</div>
Expand Down Expand Up @@ -166,20 +166,6 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/check.cr#L11" target="_blank">
check.cr
</a>

<br/>


<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L9" target="_blank">
checkable.cr
</a>

<br/>




Expand Down Expand Up @@ -290,8 +276,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/check.cr#L377" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -318,8 +302,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/check.cr#L353" target="_blank">View source</a>]

</div>
</div>

Expand Down Expand Up @@ -387,8 +369,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L67" target="_blank">View source</a>]

</div>
</div>

Expand Down Expand Up @@ -478,8 +458,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L145" target="_blank">View source</a>]

</div>
</div>

Expand Down
104 changes: 79 additions & 25 deletions docs/Check/Checkable.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_version" content="master-dev">
<meta name="crystal_docs.project_name" content="validator">


Expand All @@ -13,7 +13,7 @@
<script type="text/javascript" src="../js/doc.js"></script>

<meta name="repository-name" content="validator">
<title>Check::Checkable - validator master</title>
<title>Check::Checkable - validator master-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../";
</script>
Expand All @@ -39,7 +39,7 @@ <h1 class="project-name">
</h1>

<span class="project-version">
master
master-dev
</span>
</div>
</div>
Expand Down Expand Up @@ -168,13 +168,6 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L463" target="_blank">
checkable.cr
</a>

<br/>




Expand Down Expand Up @@ -211,7 +204,7 @@ <h2>
<li class="entry-summary">
<a href="#check(required:Bool=true,format:Bool=true):Validation-instance-method" class="signature"><strong>#check</strong>(required : Bool = <span class="n">true</span>, format : Bool = <span class="n">true</span>) : Validation</a>

<div class="summary"><p>Checks the instance fields and clean them.</p></div>
<div class="summary"><p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code> if the validation fails or if the clean has not been processed successfully.</p></div>

</li>

Expand All @@ -222,6 +215,20 @@ <h2>

</li>

<li class="entry-summary">
<a href="#check!(required:Bool=true,format:Bool=true):self-instance-method" class="signature"><strong>#check!</strong>(required : Bool = <span class="n">true</span>, format : Bool = <span class="n">true</span>) : <span class="k">self</span></a>

<div class="summary"><p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code> if the validation fails or if the clean has not been processed successfully.</p></div>

</li>

<li class="entry-summary">
<a href="#check!(v:Check::Validation,required:Bool=true,format:Bool=true):self-instance-method" class="signature"><strong>#check!</strong>(v : Check::Validation, required : Bool = <span class="n">true</span>, format : Bool = <span class="n">true</span>) : <span class="k">self</span></a>

<div class="summary"><p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code> if the validation fails or if the clean has not been processed successfully.</p></div>

</li>

</ul>


Expand Down Expand Up @@ -267,8 +274,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L486" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -293,8 +298,6 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L472" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -308,23 +311,20 @@ <h2>

<div class="doc">

<p>Checks the instance fields and clean them.</p>
<p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code>
if the validation fails or if the clean has not been processed successfully.</p>

<p>It instantiates a <code><a href="../Check/Validation.html">Check::Validation</a></code> (if not provided) and calls all methods
related to rules and then methods defined with annotation <code><a href="../Check/Checker.html">Checker</a></code>.</p>
<pre><code class="language-crystal">myCheckable.check! <span class="c"># =&gt; Returns the current instance.</span></code></pre>

<p>Lifecycle methods <code><a href="../Check/Checkable.html#before_check(v:Check::Validation,required:Bool=true,format:Bool=true)-instance-method">#before_check</a></code> and <code><a href="../Check/Checkable.html#after_check(v:Check::Validation,required:Bool=true,format:Bool=true)-instance-method">#after_check</a></code> that are triggered
respectively at the beginning and at the end of the process.</p>
<p>This method returns <code>self</code>, so it chainable :)</p>

<p><em>format</em> is used to tell cleaners generated by <code><a href="../Check.html#rules(**fields)-macro">Check.rules</a></code>
to execute format method if it has been defined.</p>
<pre><code class="language-crystal">user.email <span class="o">=</span> <span class="s">&quot;[email protected]&quot;</span>
user.check!.save</code></pre>
</div>

<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L532" target="_blank">View source</a>]

</div>
</div>

Expand Down Expand Up @@ -353,7 +353,61 @@ <h2>
<br/>
<div>

[<a href="https://github.com/Nicolab/crystal-validator/blob/d97d76fbacd2427338e0178b4c926270338c820e/src/checkable.cr#L502" target="_blank">View source</a>]
</div>
</div>

<div class="entry-detail" id="check!(required:Bool=true,format:Bool=true):self-instance-method">
<div class="signature">

def <strong>check!</strong>(required : Bool = <span class="n">true</span>, format : Bool = <span class="n">true</span>) : <span class="k">self</span>

<a class="method-permalink" href="#check!(required:Bool=true,format:Bool=true):self-instance-method">#</a>
</div>

<div class="doc">

<p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code>
if the validation fails or if the clean has not been processed successfully.</p>

<pre><code class="language-crystal">myCheckable.check! <span class="c"># =&gt; Returns the current instance.</span></code></pre>

<p>This method returns <code>self</code>, so it chainable :)</p>

<pre><code class="language-crystal">user.email <span class="o">=</span> <span class="s">&quot;[email protected]&quot;</span>
user.check!.save</code></pre>
</div>

<br/>
<div>

</div>
</div>

<div class="entry-detail" id="check!(v:Check::Validation,required:Bool=true,format:Bool=true):self-instance-method">
<div class="signature">

def <strong>check!</strong>(v : <a href="../Check/Validation.html">Check::Validation</a>, required : Bool = <span class="n">true</span>, format : Bool = <span class="n">true</span>) : <span class="k">self</span>

<a class="method-permalink" href="#check!(v:Check::Validation,required:Bool=true,format:Bool=true):self-instance-method">#</a>
</div>

<div class="doc">

<p>Same as <code><a href="../Check/Checkable.html#check(required:Bool=true,format:Bool=true):Validation-instance-method">#check</a></code> but this method raises a <code><a href="../Check/ValidationError.html">Check::ValidationError</a></code>
if the validation fails or if the clean has not been processed successfully.</p>

<pre><code class="language-crystal">v <span class="o">=</span> <span class="t">Validation</span>.new_validation
myCheckable.check!(v) <span class="c"># =&gt; Returns the current instance.</span></code></pre>

<p>This method returns <code>self</code>, so it chainable :)</p>

<pre><code class="language-crystal">v <span class="o">=</span> <span class="t">Validation</span>.new_validation
user.email <span class="o">=</span> <span class="s">&quot;[email protected]&quot;</span>
user.check!(v).save</code></pre>
</div>

<br/>
<div>

</div>
</div>
Expand Down
Loading

0 comments on commit 8690965

Please sign in to comment.