-
Notifications
You must be signed in to change notification settings - Fork 7
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
143 changed files
with
114,159 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,389 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title> | ||
Class: Toys::Acceptor::Enum | ||
|
||
— Toys | ||
|
||
</title> | ||
|
||
<link rel="stylesheet" href="../../css/style.css" type="text/css" /> | ||
|
||
<link rel="stylesheet" href="../../css/common.css" type="text/css" /> | ||
|
||
<script type="text/javascript"> | ||
pathId = "Toys::Acceptor::Enum"; | ||
relpath = '../../'; | ||
</script> | ||
|
||
|
||
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script> | ||
|
||
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script> | ||
|
||
|
||
</head> | ||
<body> | ||
<div class="nav_wrap"> | ||
<iframe id="nav" src="../../class_list.html?1"></iframe> | ||
<div id="resizer"></div> | ||
</div> | ||
|
||
<div id="main" tabindex="-1"> | ||
<div id="header"> | ||
<div id="menu"> | ||
|
||
<a href="../../_index.html">Index (E)</a> » | ||
<span class='title'><span class='object_link'><a href="../../Toys.html" title="Toys (module)">Toys</a></span></span> » <span class='title'><span class='object_link'><a href="../Acceptor.html" title="Toys::Acceptor (module)">Acceptor</a></span></span> | ||
» | ||
<span class="title">Enum</span> | ||
|
||
</div> | ||
|
||
<div id="search"> | ||
|
||
<a class="full_list_link" id="class_list_link" | ||
href="../../class_list.html"> | ||
|
||
<svg width="24" height="24"> | ||
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> | ||
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> | ||
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> | ||
</svg> | ||
</a> | ||
|
||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
|
||
<div id="content"><h1>Class: Toys::Acceptor::Enum | ||
|
||
|
||
|
||
</h1> | ||
<div class="box_info"> | ||
|
||
<dl> | ||
<dt>Inherits:</dt> | ||
<dd> | ||
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Toys::Acceptor::Base (class)">Base</a></span></span> | ||
|
||
<ul class="fullTree"> | ||
<li>Object</li> | ||
|
||
<li class="next"><span class='object_link'><a href="Base.html" title="Toys::Acceptor::Base (class)">Base</a></span></li> | ||
|
||
<li class="next">Toys::Acceptor::Enum</li> | ||
|
||
</ul> | ||
<a href="#" class="inheritanceTree">show all</a> | ||
|
||
</dd> | ||
</dl> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl> | ||
<dt>Defined in:</dt> | ||
<dd>core-docs/toys/acceptor.rb</dd> | ||
</dl> | ||
|
||
</div> | ||
|
||
<h2>Overview</h2><div class="docstring"> | ||
<div class="discussion"> | ||
<p><strong><em>Defined in the toys-core gem</em></strong></p> | ||
|
||
<p>An acceptor that recognizes a fixed set of values.</p> | ||
|
||
<p>You provide a list of valid values. The input argument string will be | ||
matched against the string forms of these valid values. If it matches, | ||
the converter will return the actual value from the valid list.</p> | ||
|
||
<p>For example, you could pass <code>[:one, :two, 3]</code> as the set of values. If | ||
an argument of <code>"two"</code> is passed in, the converter will yield a final | ||
value of the symbol <code>:two</code>. If an argument of "3" is passed in, the | ||
converter will yield the integer <code>3</code>. If an argument of "three" is | ||
passed in, the match will fail.</p> | ||
|
||
|
||
</div> | ||
</div> | ||
<div class="tags"> | ||
|
||
|
||
</div> | ||
|
||
|
||
|
||
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> | ||
<ul class="summary"> | ||
|
||
<li class="public "> | ||
<span class="summary_signature"> | ||
|
||
<a href="#values-instance_method" title="#values (instance method)">#<strong>values</strong> ⇒ Array<Object> </a> | ||
|
||
|
||
|
||
</span> | ||
|
||
|
||
|
||
|
||
<span class="note title readonly">readonly</span> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'><p>The array of enum values.</p> | ||
</div></span> | ||
|
||
</li> | ||
|
||
|
||
</ul> | ||
|
||
|
||
|
||
|
||
|
||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Toys::Acceptor::Base (class)">Base</a></span></h3> | ||
<p class="inherited"><span class='object_link'><a href="Base.html#type_desc-instance_method" title="Toys::Acceptor::Base#type_desc (method)">#type_desc</a></span>, <span class='object_link'><a href="Base.html#well_known_spec-instance_method" title="Toys::Acceptor::Base#well_known_spec (method)">#well_known_spec</a></span></p> | ||
|
||
|
||
|
||
<h2> | ||
Instance Method Summary | ||
<small><a href="#" class="summary_toggle">collapse</a></small> | ||
</h2> | ||
|
||
<ul class="summary"> | ||
|
||
<li class="public "> | ||
<span class="summary_signature"> | ||
|
||
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(values, type_desc: nil, well_known_spec: nil) ⇒ Enum </a> | ||
|
||
|
||
|
||
</span> | ||
|
||
|
||
<span class="note title constructor">constructor</span> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'><p>Create an acceptor.</p> | ||
</div></span> | ||
|
||
</li> | ||
|
||
|
||
</ul> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Toys::Acceptor::Base (class)">Base</a></span></h3> | ||
<p class="inherited"><span class='object_link'><a href="Base.html#convert-instance_method" title="Toys::Acceptor::Base#convert (method)">#convert</a></span>, <span class='object_link'><a href="Base.html#match-instance_method" title="Toys::Acceptor::Base#match (method)">#match</a></span>, <span class='object_link'><a href="Base.html#suggestions-instance_method" title="Toys::Acceptor::Base#suggestions (method)">#suggestions</a></span>, <span class='object_link'><a href="Base.html#to_s-instance_method" title="Toys::Acceptor::Base#to_s (method)">#to_s</a></span></p> | ||
<div id="constructor_details" class="method_details_list"> | ||
<h2>Constructor Details</h2> | ||
|
||
<div class="method_details first"> | ||
<h3 class="signature first" id="initialize-instance_method"> | ||
|
||
#<strong>initialize</strong>(values, type_desc: nil, well_known_spec: nil) ⇒ <tt><span class='object_link'><a href="" title="Toys::Acceptor::Enum (class)">Enum</a></span></tt> | ||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring"> | ||
<div class="discussion"> | ||
<p>Create an acceptor.</p> | ||
|
||
|
||
</div> | ||
</div> | ||
<div class="tags"> | ||
<p class="tag_title">Parameters:</p> | ||
<ul class="param"> | ||
|
||
<li> | ||
|
||
<span class='name'>values</span> | ||
|
||
|
||
<span class='type'>(<tt>Array<Object></tt>)</span> | ||
|
||
|
||
|
||
— | ||
<div class='inline'><p>Valid values.</p> | ||
</div> | ||
|
||
</li> | ||
|
||
<li> | ||
|
||
<span class='name'>type_desc</span> | ||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span> | ||
|
||
|
||
<em class="default">(defaults to: <tt>nil</tt>)</em> | ||
|
||
|
||
— | ||
<div class='inline'><p>Type description string, shown in help. | ||
Defaults to <span class='object_link'><a href="../Acceptor.html#DEFAULT_TYPE_DESC-constant" title="Toys::Acceptor::DEFAULT_TYPE_DESC (constant)">DEFAULT_TYPE_DESC</a></span>.</p> | ||
</div> | ||
|
||
</li> | ||
|
||
<li> | ||
|
||
<span class='name'>well_known_spec</span> | ||
|
||
|
||
<span class='type'>(<tt>Object</tt>)</span> | ||
|
||
|
||
<em class="default">(defaults to: <tt>nil</tt>)</em> | ||
|
||
|
||
— | ||
<div class='inline'><p>The well-known acceptor spec associated | ||
with this acceptor, or <code>nil</code> for none.</p> | ||
</div> | ||
|
||
</li> | ||
|
||
</ul> | ||
|
||
|
||
</div><table class="source_code"> | ||
<tr> | ||
<td> | ||
<pre class="lines"> | ||
|
||
|
||
243 | ||
244 | ||
245</pre> | ||
</td> | ||
<td> | ||
<pre class="code"><span class="info file"># File 'core-docs/toys/acceptor.rb', line 243</span> | ||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_values'>values</span><span class='comma'>,</span> <span class='label'>type_desc:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>well_known_spec:</span> <span class='kw'>nil</span><span class='rparen'>)</span> | ||
<span class='comment'># Source available in the toys-core gem | ||
</span><span class='kw'>end</span></pre> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
</div> | ||
|
||
<div id="instance_attr_details" class="attr_details"> | ||
<h2>Instance Attribute Details</h2> | ||
|
||
|
||
<span id=""></span> | ||
<div class="method_details first"> | ||
<h3 class="signature first" id="values-instance_method"> | ||
|
||
#<strong>values</strong> ⇒ <tt>Array<Object></tt> <span class="extras">(readonly)</span> | ||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring"> | ||
<div class="discussion"> | ||
<p>The array of enum values.</p> | ||
|
||
|
||
</div> | ||
</div> | ||
<div class="tags"> | ||
|
||
<p class="tag_title">Returns:</p> | ||
<ul class="return"> | ||
|
||
<li> | ||
|
||
|
||
<span class='type'>(<tt>Array<Object></tt>)</span> | ||
|
||
|
||
|
||
</li> | ||
|
||
</ul> | ||
|
||
</div><table class="source_code"> | ||
<tr> | ||
<td> | ||
<pre class="lines"> | ||
|
||
|
||
251 | ||
252 | ||
253</pre> | ||
</td> | ||
<td> | ||
<pre class="code"><span class="info file"># File 'core-docs/toys/acceptor.rb', line 251</span> | ||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_values'>values</span> | ||
<span class='ivar'>@values</span> | ||
<span class='kw'>end</span></pre> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
</div> | ||
|
||
<div id="footer"> | ||
Generated on Wed Jan 31 22:53:17 2024 by | ||
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> | ||
0.9.34 (ruby-3.3.0). | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.