Skip to content

Commit

Permalink
v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolab committed Apr 17, 2021
1 parent 90b764d commit c4f83e6
Show file tree
Hide file tree
Showing 17 changed files with 443 additions and 163 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,9 @@ v, content = Article.check_content(input_data["content"]?)
```sh
crystal spec
crystal tool format
./bin/ameba
```

> TODO: add `ameba`?
## Contributing

1. Fork it (<https://github.com/nicolab/crystal-validator/fork>)
Expand Down
53 changes: 37 additions & 16 deletions docs/Check.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="Check/Validation.html">Validation</a>

Expand Down Expand Up @@ -179,6 +184,25 @@ <h2>




<h2>
<a id="constant-summary" class="anchor" href="#constant-summary">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Constant Summary
</h2>

<dl>

<dt class="entry-const" id="RULES">
<strong>RULES</strong> = <code>{} <span class="k">of</span> <span class="t">String</span> => <span class="t">HashLiteral</span>(<span class="t">String</span>, <span class="t">ASTNode</span>)</code>
</dt>


</dl>




Expand Down Expand Up @@ -350,23 +374,20 @@ <h2>
<span class="t">Check</span>.checkable

property title : <span class="t">String</span>
property content : <span class="t">String</span>

<span class="t">Check</span>.rules(
content: {
check: {
not_empty: {<span class="s">&quot;Article content is required&quot;</span>},
between: {<span class="s">&quot;The article content must be between 10 and 20 000 characters&quot;</span>, <span class="n">10</span>, <span class="n">20_000</span>},
<span class="c"># ...</span>
},
clean: {
<span class="k">type</span>: <span class="t">String</span>,
to: <span class="n">:to_s</span>,
format: ->(content : <span class="t">String</span>) { content.strip },
message: <span class="s">&quot;Wrong type&quot;</span>,
},
property content : <span class="t">String</span>, {
required: <span class="n">true</span>,
check: {
not_empty: {<span class="s">&quot;Article content is required&quot;</span>},
between: {<span class="s">&quot;The article content must be between 10 and 20 000 characters&quot;</span>, <span class="n">10</span>, <span class="n">20_000</span>},
<span class="c"># ...</span>
},
clean: {
<span class="k">type</span>: <span class="t">String</span>,
to: <span class="n">:to_s</span>,
format: ->(content : <span class="t">String</span>) { content.strip },
message: <span class="s">&quot;Wrong type&quot;</span>,
},
)
}
<span class="k">end</span>

<span class="c"># Triggered on all data</span>
Expand Down
5 changes: 5 additions & 0 deletions docs/Check/Checkable.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Check/CheckableStatic.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Check/Checker.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Check/Errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
208 changes: 208 additions & 0 deletions docs/Check/Prop.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.36.1">
<meta name="crystal_docs.project_version" content="master-dev">
<meta name="crystal_docs.project_name" content="validator">



<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/doc.js"></script>

<meta name="repository-name" content="validator">
<title>Check::Prop - validator master-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../";
</script>
</head>
<body>

<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
<input type="search" class="search-input" placeholder="Search..." spellcheck="false" aria-label="Search">
</div>

<div class="project-summary">
<h1 class="project-name">
<a href="../index.html">
validator
</a>
</h1>

<span class="project-version">
master-dev
</span>
</div>
</div>

<div class="search-results hidden">
<ul class="search-list"></ul>
</div>

<div class="types-list">
<ul>

<li class=" " data-id="validator/toplevel" data-name="top level namespace">
<a href="../toplevel.html">Top Level Namespace</a>

</li>

<li class="parent open current" data-id="validator/Check" data-name="check">
<a href="../Check.html">Check</a>

<ul>

<li class=" " data-id="validator/Check/Checkable" data-name="check::checkable">
<a href="../Check/Checkable.html">Checkable</a>

</li>

<li class=" " data-id="validator/Check/CheckableStatic" data-name="check::checkablestatic">
<a href="../Check/CheckableStatic.html">CheckableStatic</a>

</li>

<li class=" " data-id="validator/Check/Checker" data-name="check::checker">
<a href="../Check/Checker.html">Checker</a>

</li>

<li class=" " data-id="validator/Check/Errors" data-name="check::errors">
<a href="../Check/Errors.html">Errors</a>

</li>

<li class=" current" data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

</li>

<li class=" " data-id="validator/Check/ValidationError" data-name="check::validationerror">
<a href="../Check/ValidationError.html">ValidationError</a>

</li>

</ul>


</li>

<li class=" " data-id="validator/Valid" data-name="valid">
<a href="../Valid.html">Valid</a>

</li>

<li class="parent " data-id="validator/Validator" data-name="validator">
<a href="../Validator.html">Validator</a>

<ul>

<li class=" " data-id="validator/Validator/Error" data-name="validator::error">
<a href="../Validator/Error.html">Error</a>

</li>

</ul>


</li>

</ul>

</div>
</div>


<div class="main-content">
<h1 class="type-name">

<span class="kind">module</span> Check::Prop

</h1>





<h2>
<a id="overview" class="anchor" href="#overview">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Overview
</h2>

<p>A mixin to make the <code>getter</code> macro of the Crystal std's,
able to support the rules definition and factory block.</p>














<h2>
<a id="defined-in" class="anchor" href="#defined-in">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Defined in:
</h2>


checkable.cr

<br/>














<div class="methods-inherited">

</div>









</div>

</body>
</html>
5 changes: 5 additions & 0 deletions docs/Check/Validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" current" data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Check/ValidationError.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="../Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="../Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="Check/Validation.html">Validation</a>

Expand Down
5 changes: 5 additions & 0 deletions docs/Validator.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ <h1 class="project-name">

</li>

<li class=" " data-id="validator/Check/Prop" data-name="check::prop">
<a href="Check/Prop.html">Prop</a>

</li>

<li class=" " data-id="validator/Check/Validation" data-name="check::validation">
<a href="Check/Validation.html">Validation</a>

Expand Down
Loading

0 comments on commit c4f83e6

Please sign in to comment.