-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
202 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"> | ||
|
||
|
||
|
@@ -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> | ||
|
@@ -39,7 +39,7 @@ <h1 class="project-name"> | |
</h1> | ||
|
||
<span class="project-version"> | ||
master | ||
master-dev | ||
</span> | ||
</div> | ||
</div> | ||
|
@@ -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/> | ||
|
||
|
||
|
||
|
||
|
@@ -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> | ||
|
||
|
@@ -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> | ||
|
||
|
||
|
@@ -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> | ||
|
||
|
@@ -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> | ||
|
||
|
@@ -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"># => 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">"[email protected]"</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> | ||
|
||
|
@@ -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"># => 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">"[email protected]"</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"># => 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">"[email protected]"</span> | ||
user.check!(v).save</code></pre> | ||
</div> | ||
|
||
<br/> | ||
<div> | ||
|
||
</div> | ||
</div> | ||
|
Oops, something went wrong.