Added queries, multipart/form-data parser, and a couple examples on how to use them as of right now

This commit is contained in:
Yessiest 2023-09-10 14:46:57 +04:00
parent 041a9844d9
commit bfc9a3066b
54 changed files with 14549 additions and 169 deletions

View File

@ -1,5 +1,21 @@
lib/hyde.rb 6b22abff461426484b51291071193f02c2cf7850
lib/hyde/pattern_matching.rb 84399fe8cc7f55b1da9a9348759a75ba1e6374e6
lib/hyde/pattern_matching/glob.rb c8dab66857e6da3770f94ab26134ec27d262f240
lib/hyde.rb 775368f05e89c7396fdf9a9c1f55e3537f8fba98
lib/hyde/node.rb 93d92492390abb2b55649c6d027fa3a2cb8f2014
lib/hyde/path.rb 280170523467824ac6ce310500fc88439808d59e
lib/hyde/probe.rb 994a5527bb30c713c1c70e56195ea6967ae39241
lib/hyde/server.rb 3286219acc8606b432d12545e9ba3a57dd227473
lib/hyde/request.rb 9baea24ae9975e3a26571878ed7e9da99889584f
lib/hyde/response.rb 0f0c107c7db883b308b81cbf5c0c4b7d5c90e7ba
lib/hyde/util/html.rb 3767a1632026ba555ae5517b59728b2e916b61de
lib/hyde/util/query.rb ffa6f9b6631277d7061f63dd36e4cb431a8169f5
lib/hyde/util/lookup.rb 5b8e28a8471bb786f4e0a0d616885d238c806661
lib/hyde/probe/binding.rb 1a83cfea5e7b620d075798c920dd4af3335871c7
lib/hyde/probe/handler.rb 4d45e895a3bfee8e5234be3862c7e201772731b1
lib/hyde/dsl/path_methods.rb 0369e370c594f0bd5c987c67791175eeaa8f9c21
lib/hyde/pattern_matching.rb fe86f6529a2d22c128d9d3a74217862e9fa59c15
lib/hyde/dsl/probe_methods.rb a9dd3ddbdf89875d79d5ca3e56fd3a261546dd25
lib/hyde/probe/http_method.rb f5f6874998e4a581cd3673a06f3536c8a14e67c8
lib/hyde/probe/serve_handler.rb 1690e7dd3f0abe9180a61d474bb89c0a765fc381
lib/hyde/dsl/path_constructors.rb 97895412fc27eeb7f3fa379a85972c97a24d97bf
lib/hyde/pattern_matching/glob.rb 16595083bc8d6f7b98f4adda502a05bd411bc1ca
lib/hyde/pattern_matching/util.rb 188dc7d5d9a9a6538a01943a83eb132c385dc092
lib/hyde/pattern_matching/rematch.rb 54a4f94791e68d85c38034d954e4c3174e01511b

Binary file not shown.

Binary file not shown.

View File

@ -79,7 +79,7 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde.rb<span class="defines">,<br />
lib/hyde/pattern_matching.rb,<br /> lib/hyde/pattern_matching/glob.rb,<br /> lib/hyde/pattern_matching/util.rb,<br /> lib/hyde/pattern_matching/rematch.rb</span>
lib/hyde/node.rb,<br /> lib/hyde/path.rb,<br /> lib/hyde/probe.rb,<br /> lib/hyde/server.rb,<br /> lib/hyde/request.rb,<br /> lib/hyde/response.rb,<br /> lib/hyde/util/html.rb,<br /> lib/hyde/util/query.rb,<br /> lib/hyde/util/lookup.rb,<br /> lib/hyde/probe/binding.rb,<br /> lib/hyde/probe/handler.rb,<br /> lib/hyde/dsl/path_methods.rb,<br /> lib/hyde/pattern_matching.rb,<br /> lib/hyde/dsl/probe_methods.rb,<br /> lib/hyde/probe/http_method.rb,<br /> lib/hyde/probe/serve_handler.rb,<br /> lib/hyde/dsl/path_constructors.rb,<br /> lib/hyde/pattern_matching/glob.rb,<br /> lib/hyde/pattern_matching/util.rb,<br /> lib/hyde/pattern_matching/rematch.rb</span>
</dd>
</dl>
@ -100,15 +100,74 @@
<p class="children">
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Hyde/PatternMatching.html" title="Hyde::PatternMatching (module)">PatternMatching</a></span>
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Hyde/DSL.html" title="Hyde::DSL (module)">DSL</a></span>, <span class='object_link'><a href="Hyde/PatternMatching.html" title="Hyde::PatternMatching (module)">PatternMatching</a></span>, <span class='object_link'><a href="Hyde/Util.html" title="Hyde::Util (module)">Util</a></span>
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Hyde/Path.html" title="Hyde::Path (class)">Path</a></span>, <span class='object_link'><a href="Hyde/PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span>, <span class='object_link'><a href="Hyde/Pattern.html" title="Hyde::Pattern (class)">Pattern</a></span>
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Hyde/CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span>, <span class='object_link'><a href="Hyde/DELETEHandler.html" title="Hyde::DELETEHandler (class)">DELETEHandler</a></span>, <span class='object_link'><a href="Hyde/GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span>, <span class='object_link'><a href="Hyde/HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span>, <span class='object_link'><a href="Hyde/Handler.html" title="Hyde::Handler (class)">Handler</a></span>, <span class='object_link'><a href="Hyde/Node.html" title="Hyde::Node (class)">Node</a></span>, <span class='object_link'><a href="Hyde/OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span>, <span class='object_link'><a href="Hyde/PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span>, <span class='object_link'><a href="Hyde/POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span>, <span class='object_link'><a href="Hyde/PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span>, <span class='object_link'><a href="Hyde/Path.html" title="Hyde::Path (class)">Path</a></span>, <span class='object_link'><a href="Hyde/PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span>, <span class='object_link'><a href="Hyde/Pattern.html" title="Hyde::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Hyde/Probe.html" title="Hyde::Probe (class)">Probe</a></span>, <span class='object_link'><a href="Hyde/ProbeBinding.html" title="Hyde::ProbeBinding (class)">ProbeBinding</a></span>, <span class='object_link'><a href="Hyde/Request.html" title="Hyde::Request (class)">Request</a></span>, <span class='object_link'><a href="Hyde/Response.html" title="Hyde::Response (class)">Response</a></span>, <span class='object_link'><a href="Hyde/ServeHandler.html" title="Hyde::ServeHandler (class)">ServeHandler</a></span>, <span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span>, <span class='object_link'><a href="Hyde/ServerBinding.html" title="Hyde::ServerBinding (class)">ServerBinding</a></span>, <span class='object_link'><a href="Hyde/TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span>
</p>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="VERSION-constant" class="">VERSION =
<div class="docstring">
<div class="discussion">
<p>Hyde version</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.8 (beta/rewrite)</span><span class='tstring_end'>&#39;</span></span></pre></dd>
<dt id="VLINE-constant" class="">VLINE =
<div class="docstring">
<div class="discussion">
<p>Hyde branding and version</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hyde/</span><span class='embexpr_beg'>#{</span><span class='const'>Hyde</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#VERSION-constant" title="Hyde::VERSION (constant)">VERSION</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'> (Ruby/</span><span class='embexpr_beg'>#{</span><span class='const'>RUBY_VERSION</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='const'>RUBY_RELEASE_DATE</span><span class='embexpr_end'>}</span><span class='tstring_content'>)\n</span><span class='tstring_end'>&quot;</span></span></pre></dd>
<dt id="COPYRIGHT-constant" class="">COPYRIGHT =
<div class="docstring">
<div class="discussion">
<p>Hyde copyright</p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Copyright 2023 Yessiest</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
@ -120,7 +179,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::CONNECTHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::CONNECTHandler";
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 (C)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">CONNECTHandler</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: Hyde::CONNECTHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::CONNECTHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a CONNECT</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CONNECT</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/DELETEHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::DELETEHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::DELETEHandler";
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 (D)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">DELETEHandler</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: Hyde::DELETEHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::DELETEHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a DELETE</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>DELETE</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

128
doc/Hyde/DSL.html Normal file
View File

@ -0,0 +1,128 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Hyde::DSL
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::DSL";
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 (D)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">DSL</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>Module: Hyde::DSL
</h1>
<div class="box_info">
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/dsl/path_methods.rb<span class="defines">,<br />
lib/hyde/dsl/probe_methods.rb,<br /> lib/hyde/dsl/path_constructors.rb</span>
</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Shared DSL methods</p>
</div>
</div>
<div class="tags">
</div><h2>Defined Under Namespace</h2>
<p class="children">
<strong class="modules">Modules:</strong> <span class='object_link'><a href="DSL/PathConstructors.html" title="Hyde::DSL::PathConstructors (module)">PathConstructors</a></span>, <span class='object_link'><a href="DSL/PathMethods.html" title="Hyde::DSL::PathMethods (module)">PathMethods</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html" title="Hyde::DSL::ProbeMethods (module)">ProbeMethods</a></span>
</p>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,995 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Hyde::DSL::PathConstructors
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::DSL::PathConstructors";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../DSL.html" title="Hyde::DSL (module)">DSL</a></span></span>
&raquo;
<span class="title">PathConstructors</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>Module: Hyde::DSL::PathConstructors
</h1>
<div class="box_info">
<dl>
<dt>Included in:</dt>
<dd><span class='object_link'><a href="../PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/dsl/path_constructors.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Path (and subclasses) DSL constructors</p>
</div>
</div>
<div class="tags">
</div>
<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="#connect-instance_method" title="#connect (instance method)">#<strong>connect</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../DELETEHandler.html" title="Hyde::DELETEHandler (class)">Hyde::DELETEHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#get-instance_method" title="#get (instance method)">#<strong>get</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#head-instance_method" title="#head (instance method)">#<strong>head</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#options-instance_method" title="#options (instance method)">#<strong>options</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#patch-instance_method" title="#patch (instance method)">#<strong>patch</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#path-instance_method" title="#path (instance method)">#<strong>path</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../Path.html" title="Hyde::Path (class)">Path</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#post-instance_method" title="#post (instance method)">#<strong>post</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>create a new <span class='object_link'><a href="../POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#probe-instance_method" title="#probe (instance method)">#<strong>probe</strong>(path, &amp;_setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../Probe.html" title="Hyde::Probe (class)">Probe</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#put-instance_method" title="#put (instance method)">#<strong>put</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span> object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#register-instance_method" title="#register (instance method)">#<strong>register</strong>(obj) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Append a Node child object to the list of children.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#serve-instance_method" title="#serve (instance method)">#<strong>serve</strong>(path) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span> that serves static files.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#trace-instance_method" title="#trace (instance method)">#<strong>trace</strong>(path, &amp;setup) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Create a new <span class='object_link'><a href="../TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span> object.</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="connect-instance_method">
#<strong>connect</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
55
56
57</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 55</span>
<span class='kw'>def</span> <span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete-instance_method">
#<strong>delete</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../DELETEHandler.html" title="Hyde::DELETEHandler (class)">Hyde::DELETEHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 50</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../DELETEHandler.html" title="Hyde::DELETEHandler (class)">DELETEHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="get-instance_method">
#<strong>get</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 30</span>
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="head-instance_method">
#<strong>head</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 45</span>
<span class='kw'>def</span> <span class='id identifier rubyid_head'>head</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="options-instance_method">
#<strong>options</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
70
71
72</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 70</span>
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="patch-instance_method">
#<strong>patch</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65
66
67</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_patch'>patch</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="path-instance_method">
#<strong>path</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../Path.html" title="Hyde::Path (class)">Path</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
18
19
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 18</span>
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='comment'># i don&#39;t know WHAT is wrong with this thing. it just is wrong.
</span> <span class='comment'># @sg-ignore
</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Path.html" title="Hyde::Path (class)">Path</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Path.html#initialize-instance_method" title="Hyde::Path#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="post-instance_method">
#<strong>post</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>create a new <span class='object_link'><a href="../POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
35
36
37</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="probe-instance_method">
#<strong>probe</strong>(path, &amp;_setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../Probe.html" title="Hyde::Probe (class)">Probe</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 25</span>
<span class='kw'>def</span> <span class='id identifier rubyid_probe'>probe</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid__setup'>_setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Probe.html" title="Hyde::Probe (class)">Probe</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="put-instance_method">
#<strong>put</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
40
41
42</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 40</span>
<span class='kw'>def</span> <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="register-instance_method">
#<strong>register</strong>(obj) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Append a Node child object to the list of children</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
9
10
11
12
13
14
15</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 9</span>
<span class='kw'>def</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_obj'>obj</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Node.html" title="Hyde::Node (class)">Node</a></span></span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>register accepts node children only</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='id identifier rubyid_obj'>obj</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="serve-instance_method">
#<strong>serve</strong>(path) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span> that serves static files</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
75
76
77</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 75</span>
<span class='kw'>def</span> <span class='id identifier rubyid_serve'>serve</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../ServeHandler.html" title="Hyde::ServeHandler (class)">ServeHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../ServeHandler.html#initialize-instance_method" title="Hyde::ServeHandler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="trace-instance_method">
#<strong>trace</strong>(path, &amp;setup) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Create a new <span class='object_link'><a href="../TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span> object</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
60
61
62</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_constructors.rb', line 60</span>
<span class='kw'>def</span> <span class='id identifier rubyid_trace'>trace</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='ivar'>@origin</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,704 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Hyde::DSL::PathMethods
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::DSL::PathMethods";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../DSL.html" title="Hyde::DSL (module)">DSL</a></span></span>
&raquo;
<span class="title">PathMethods</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>Module: Hyde::DSL::PathMethods
</h1>
<div class="box_info">
<dl>
<dt>Included in:</dt>
<dd><span class='object_link'><a href="../PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/dsl/path_methods.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Common path methods</p>
</div>
</div>
<div class="tags">
</div>
<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="#filter-instance_method" title="#filter (instance method)">#<strong>filter</strong>(&amp;block) {|request| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a filter to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#index-instance_method" title="#index (instance method)">#<strong>index</strong>(index) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set path index.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#postprocess-instance_method" title="#postprocess (instance method)">#<strong>postprocess</strong>(&amp;block) {|request, response| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a postprocessor to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#preprocess-instance_method" title="#preprocess (instance method)">#<strong>preprocess</strong>(&amp;block) {|request| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a preprocessor to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remap-instance_method" title="#remap (instance method)">#<strong>remap</strong>(path) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set root path (without appending matched part).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#root-instance_method" title="#root (instance method)">#<strong>root</strong>(path) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set root path (appends matched part of the path).</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="filter-instance_method">
#<strong>filter</strong>(&amp;block) {|request| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a filter to the path. Blocks path access if a filter returns false.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="../Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
55
56
57
58</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 55</span>
<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_block'>block</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="index-instance_method">
#<strong>index</strong>(index) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set path index</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>index</span>
<span class='type'>(<tt>Array</tt>, <tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
10
11
12
13
14
15
16
17
18
19</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
<span class='kw'>case</span> <span class='id identifier rubyid_index'>index</span>
<span class='kw'>when</span> <span class='const'>Array</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>index</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_index'>index</span>
<span class='kw'>when</span> <span class='const'>String</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>index</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index should be an Array or a String</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="postprocess-instance_method">
#<strong>postprocess</strong>(&amp;block) {|request, response| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a postprocessor to the path.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="../Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
<li>
<span class='name'>response</span>
<span class='type'>(<tt><span class='object_link'><a href="../Response.html" title="Hyde::Response (class)">Hyde::Response</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
46
47
48
49</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 46</span>
<span class='kw'>def</span> <span class='id identifier rubyid_postprocess'>postprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_postprocess'>postprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_block'>block</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="preprocess-instance_method">
#<strong>preprocess</strong>(&amp;block) {|request| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a preprocessor to the path. Does not modify path execution.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="../Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
37
38
39
40</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 37</span>
<span class='kw'>def</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_block'>block</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remap-instance_method">
#<strong>remap</strong>(path) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set root path (without appending matched part).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>ath [String</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
29
30
31</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 29</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remap'>remap</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_remap'>remap</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="root-instance_method">
#<strong>root</strong>(path) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set root path (appends matched part of the path).</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>ath [String</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
23
24
25</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/path_methods.rb', line 23</span>
<span class='kw'>def</span> <span class='id identifier rubyid_root'><span class='object_link'><a href="../../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,767 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Hyde::DSL::ProbeMethods
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::DSL::ProbeMethods";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../DSL.html" title="Hyde::DSL (module)">DSL</a></span></span>
&raquo;
<span class="title">ProbeMethods</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>Module: Hyde::DSL::ProbeMethods
</h1>
<div class="box_info">
<dl>
<dt>Included in:</dt>
<dd><span class='object_link'><a href="../ProbeBinding.html" title="Hyde::ProbeBinding (class)">ProbeBinding</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/dsl/probe_methods.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Common methods for Probe objects</p>
</div>
</div>
<div class="tags">
</div>
<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="#bounce-instance_method" title="#bounce (instance method)">#<strong>bounce</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Bounce request to the next handler.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#die-instance_method" title="#die (instance method)">#<strong>die</strong>(errorcode, backtrace: nil) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Stop execution and generate a boilerplate response with the given code.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#header-instance_method" title="#header (instance method)">#<strong>header</strong>(key, value) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set response header (generate response if one doesnt exist yet).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_header-instance_method" title="#remove_header (instance method)">#<strong>remove_header</strong>(key, value = nil) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Delete a header value from the headers hash If no value is provided, deletes all key entries.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#request-instance_method" title="#request (instance method)">#<strong>request</strong> &#x21d2; Hyde::Request </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get the current request.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#status-instance_method" title="#status (instance method)">#<strong>status</strong>(status) &#x21d2; Object </a>
(also: #code)
</span>
<span class="summary_desc"><div class='inline'>
<p>Set response status (generate response if one doesnt exist yet).</p>
</div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="bounce-instance_method">
#<strong>bounce</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Bounce request to the next handler</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>UncaughtThrowError</tt>)</span>
&mdash;
<div class='inline'>
<p>throws :break to get out of the callback</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
31
32
33</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 31</span>
<span class='kw'>def</span> <span class='id identifier rubyid_bounce'>bounce</span>
<span class='id identifier rubyid_throw'>throw</span> <span class='symbol'>:break</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="die-instance_method">
#<strong>die</strong>(errorcode, backtrace: nil) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Stop execution and generate a boilerplate response with the given code</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>errorcode</span>
<span class='type'>(<tt>Integer</tt>)</span>
</li>
<li>
<span class='name'>backtrace</span>
<span class='type'>(<tt>Array(String)</tt>, <tt>nil</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>UncaughtThrowError</tt>)</span>
&mdash;
<div class='inline'>
<p>throws :finish to return back to Server</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20
21
22
23
24
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_die'>die</span><span class='lparen'>(</span><span class='id identifier rubyid_errorcode'>errorcode</span><span class='comma'>,</span> <span class='label'>backtrace:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_throw'>throw</span> <span class='symbol'>:finish</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_errorcode'>errorcode</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span>
<span class='op'>*</span><span class='lparen'>(</span><span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>handle.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_errorcode'>errorcode</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='kw'>or</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_properties'>properties</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>handle.default</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span>
<span class='id identifier rubyid_errorcode'>errorcode</span><span class='comma'>,</span>
<span class='label'>backtrace:</span> <span class='id identifier rubyid_backtrace'>backtrace</span>
<span class='rparen'>)</span>
<span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="header-instance_method">
#<strong>header</strong>(key, value) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set response header (generate response if one doesnt exist yet)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>key</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>header name</p>
</div>
</li>
<li>
<span class='name'>value</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>header value</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 47</span>
<span class='kw'>def</span> <span class='id identifier rubyid_header'>header</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_status'>status</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>status</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?:[(),\/:;&lt;=&gt;?@\[\]{}&quot;]|[^ -~])</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>header key has invalid characters</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^ -~]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>value key has invalid characters</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span> <span class='kw'>or</span> <span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Response.html" title="Hyde::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Response.html#initialize-instance_method" title="Hyde::Response#initialize (method)">new</a></span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_add_header'>add_header</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_header-instance_method">
#<strong>remove_header</strong>(key, value = nil) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Delete a header value from the headers hash If no value is provided, deletes all key entries</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>key</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>header name</p>
</div>
</li>
<li>
<span class='name'>value</span>
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>header value</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 67</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_header'>remove_header</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>status</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(?:[(),\/:;&lt;=&gt;?@\[\]{}&quot;]|[^ -~])</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>header key has invalid characters</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='op'>&amp;.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[^ -~]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>value key has invalid characters</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_delete_header'>delete_header</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="request-instance_method">
#<strong>request</strong> &#x21d2; <tt><span class='object_link'><a href="../Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Get the current request</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 11</span>
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span>
<span class='ivar'>@origin</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="status-instance_method">
#<strong>status</strong>(status) &#x21d2; <tt>Object</tt>
<span class="aliases">Also known as:
<span class="names"><span id='code-instance_method'>code</span></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p>Set response status (generate response if one doesnt exist yet)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>status</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>http status code</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
37
38
39
40</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/dsl/probe_methods.rb', line 37</span>
<span class='kw'>def</span> <span class='id identifier rubyid_status'>status</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='rparen'>)</span>
<span class='ivar'>@response</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@response</span> <span class='kw'>or</span> <span class='const'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Response.html" title="Hyde::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../Response.html#initialize-instance_method" title="Hyde::Response#initialize (method)">new</a></span></span><span class='rparen'>)</span>
<span class='ivar'>@response</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_status'>status</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

366
doc/Hyde/GETHandler.html Normal file
View File

@ -0,0 +1,366 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::GETHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::GETHandler";
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 (G)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">GETHandler</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: Hyde::GETHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next">Hyde::GETHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a GET</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span>, <span class='object_link'><a href="DELETEHandler.html" title="Hyde::DELETEHandler (class)">DELETEHandler</a></span>, <span class='object_link'><a href="HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span>, <span class='object_link'><a href="OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span>, <span class='object_link'><a href="PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span>, <span class='object_link'><a href="POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span>, <span class='object_link'><a href="PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span>, <span class='object_link'><a href="TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span></p>
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>GET</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="process-instance_method">
#<strong>process</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation. Runs block supplied with object initialization. Requests #splat and #param are passed to block.</p>
<p>Callbacks returned should be one of viable responses:</p>
<ul><li>
<p><span class='object_link'><a href="Response.html" title="Hyde::Response (class)">Response</a></span> object</p>
</li><li>
<p>An array that matches Rack return form</p>
</li><li>
<p>An array that matches old (Rack 2.x) return form</p>
</li><li>
<p>A string (returned as HTML with code 200)</p>
</li><li>
<p>false (bounces the request to next handler)</p>
</li></ul>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>true if further navigation is possible</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>UncaughtThrowError</tt>)</span>
&mdash;
<div class='inline'>
<p>may raise if die() is called.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
26
27
28
29
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/http_method.rb', line 26</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_request_method'>request_method</span><span class='period'>.</span><span class='id identifier rubyid_casecmp'>casecmp</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='op'>::</span><span class='const'>METHOD</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
<span class='kw'>return</span> <span class='kw'>false</span>
<span class='kw'>end</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/HEADHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::HEADHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::HEADHandler";
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 (H)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">HEADHandler</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: Hyde::HEADHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::HEADHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a HEAD</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HEAD</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

609
doc/Hyde/Handler.html Normal file
View File

@ -0,0 +1,609 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Handler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Handler";
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 (H)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">Handler</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: Hyde::Handler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next">Hyde::Handler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/handler.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes a callback on request</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></p>
</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="#request-instance_method" title="#request (instance method)">#<strong>request</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute request.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#response-instance_method" title="#response (instance method)">#<strong>response</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute response.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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>(path, parent:, &amp;exec) &#x21d2; Handler </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Handler.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</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>(path, parent:, &amp;exec) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Handler (class)">Handler</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Handler.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>Object</tt>)</span>
</li>
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Hyde::Node</a></span></tt>)</span>
</li>
<li>
<span class='name'>exec</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14
15
16
17</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/handler.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_exec'>exec</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
<span class='ivar'>@callback</span> <span class='op'>=</span> <span class='id identifier rubyid_exec'>exec</span>
<span class='ivar'>@binding</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ProbeBinding.html" title="Hyde::ProbeBinding (class)">ProbeBinding</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ProbeBinding.html#initialize-instance_method" title="Hyde::ProbeBinding#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
<span class='ivar'>@response</span> <span class='op'>=</span> <span class='kw'>nil</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="request-instance_method">
#<strong>request</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute request.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/handler.rb', line 20</span>
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span>
<span class='ivar'>@request</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="response=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="response-instance_method">
#<strong>response</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute response.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20
21</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/handler.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_response'>response</span>
<span class='ivar'>@response</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="process-instance_method">
#<strong>process</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation. Runs block supplied with object initialization. Requests #splat and #param are passed to block.</p>
<p>Callbacks returned should be one of viable responses:</p>
<ul><li>
<p><span class='object_link'><a href="Response.html" title="Hyde::Response (class)">Response</a></span> object</p>
</li><li>
<p>An array that matches Rack return form</p>
</li><li>
<p>An array that matches old (Rack 2.x) return form</p>
</li><li>
<p>A string (returned as HTML with code 200)</p>
</li><li>
<p>false (bounces the request to next handler)</p>
</li></ul>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>true if further navigation is possible</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>UncaughtThrowError</tt>)</span>
&mdash;
<div class='inline'>
<p>may raise if die() is called.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/handler.rb', line 36</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='ivar'>@response</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>return</span> <span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/?$</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='ivar'>@request</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:break</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='ivar'>@binding</span><span class='period'>.</span><span class='id identifier rubyid_instance_exec'>instance_exec</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_splat'>splat</span><span class='comma'>,</span>
<span class='op'>**</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_param'>param</span><span class='comma'>,</span>
<span class='op'>&amp;</span><span class='ivar'>@callback</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_response'>response</span>
<span class='kw'>if</span> <span class='ivar'>@response</span> <span class='kw'>and</span> <span class='lbracket'>[</span><span class='const'>String</span><span class='comma'>,</span> <span class='const'>File</span><span class='comma'>,</span> <span class='const'>IO</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span>
<span class='ivar'>@response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span>
<span class='id identifier rubyid_throw'>throw</span> <span class='symbol'>:finish</span><span class='comma'>,</span> <span class='ivar'>@response</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_throw'>throw</span> <span class='symbol'>:finish</span><span class='comma'>,</span> <span class='id identifier rubyid_response'>response</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

714
doc/Hyde/Node.html Normal file
View File

@ -0,0 +1,714 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Node
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Node";
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 (N)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">Node</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: Hyde::Node
<span class="abstract note title">Abstract</span>
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Hyde::Node</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/node.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<div class="note abstract">
<strong>This class is abstract.</strong>
<div class='inline'></div>
</div>
<p>Abstract class that reacts to request navigation. Does nothing by default, behaviour should be overriden through #reject and #process</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="Path.html" title="Hyde::Path (class)">Path</a></span>, <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></p>
</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="#remap-instance_method" title="#remap (instance method)">#<strong>remap</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute remap.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#root-instance_method" title="#root (instance method)">#<strong>root</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute root.</p>
</div></span>
</li>
</ul>
<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="#go-instance_method" title="#go (instance method)">#<strong>go</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Try to navigate the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(path, parent:) &#x21d2; Node </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Node.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(_request) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#reject-instance_method" title="#reject (instance method)">#<strong>reject</strong>(_request) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on failed request navigation.</p>
</div></span>
</li>
</ul>
<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>(path, parent:) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Node (class)">Node</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Node.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>Object</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14
15
16
17</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span><span class='rparen'>)</span>
<span class='ivar'>@pattern</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Pattern.html" title="Hyde::Pattern (class)">Pattern</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pattern.html#initialize-instance_method" title="Hyde::Pattern#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
<span class='ivar'>@properties</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="Hyde::Util (module)">Util</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util/Lookup.html" title="Hyde::Util::Lookup (class)">Lookup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Util/Lookup.html#initialize-instance_method" title="Hyde::Util::Lookup#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='op'>&amp;.</span><span class='id identifier rubyid_properties'>properties</span><span class='rparen'>)</span>
<span class='ivar'>@root</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='ivar'>@remap</span> <span class='op'>=</span> <span class='kw'>false</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="remap=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="remap-instance_method">
#<strong>remap</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute remap.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
69
70
71</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 69</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remap'>remap</span>
<span class='ivar'>@remap</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="root=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="root-instance_method">
#<strong>root</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute root.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
69
70
71</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 69</span>
<span class='kw'>def</span> <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span>
<span class='ivar'>@root</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="go-instance_method">
#<strong>go</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Try to navigate the path. Run method callback in response.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'></span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 38</span>
<span class='kw'>def</span> <span class='id identifier rubyid_go'>go</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='comment'># rejected at pattern
</span> <span class='kw'>return</span> <span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='ivar'>@pattern</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_push_state'>push_state</span>
<span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_splat'>splat</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span> <span class='op'>=</span> <span class='ivar'>@pattern</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='id identifier rubyid_do_filepath'>do_filepath</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='comma'>,</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_delete_suffix'>delete_suffix</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_splat'>splat</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_splat'>splat</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_param'>param</span><span class='rparen'>)</span>
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='comment'># rejected at callback - restore state
</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_pop_state'>pop_state</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span>
<span class='comment'># finally, return process value
</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="process-instance_method">
#<strong>process</strong>(_request) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>_request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'></span>
<div class='inline'>
<p>true</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65
66
67</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid__request'>_request</span><span class='rparen'>)</span>
<span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="reject-instance_method">
#<strong>reject</strong>(_request) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on failed request navigation</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>_request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'></span>
<div class='inline'>
<p>false</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/node.rb', line 58</span>
<span class='kw'>def</span> <span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='id identifier rubyid__request'>_request</span><span class='rparen'>)</span>
<span class='kw'>false</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::OPTIONSHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::OPTIONSHandler";
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 (O)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">OPTIONSHandler</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: Hyde::OPTIONSHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::OPTIONSHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a OPTIONS</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OPTIONS</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/PATCHHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::PATCHHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::PATCHHandler";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">PATCHHandler</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: Hyde::PATCHHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::PATCHHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a PATCH</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>PATCH</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/POSTHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::POSTHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::POSTHandler";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">POSTHandler</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: Hyde::POSTHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::POSTHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a POST</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>POST</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/PUTHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::PUTHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::PUTHandler";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">PUTHandler</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: Hyde::PUTHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::PUTHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a PUT</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>PUT</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -69,11 +69,13 @@
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<span class="inheritName"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next">Hyde::Path</li>
</ul>
@ -94,24 +96,808 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde.rb</dd>
<dd>lib/hyde/path.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Primary building block of request navigation.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="Server.html" title="Hyde::Server (class)">Server</a></span></p>
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="Binding-constant" class="">Binding =
</dt>
<dd><pre class="code"><span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></span></pre></dd>
</dl>
<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="#children-instance_method" title="#children (instance method)">#<strong>children</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute children.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#properties-instance_method" title="#properties (instance method)">#<strong>properties</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute properties.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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="#filter-instance_method" title="#filter (instance method)">#<strong>filter</strong>(&amp;block) {|request| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a filter to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(path, parent:, &amp;setup) &#x21d2; Path </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#postprocess-instance_method" title="#postprocess (instance method)">#<strong>postprocess</strong>(&amp;block) {|request, response| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a postprocessor to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#preprocess-instance_method" title="#preprocess (instance method)">#<strong>preprocess</strong>(&amp;block) {|request| ... } &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a preprocessor to the path.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</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>(path, parent:, &amp;setup) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Path (class)">Path</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Path.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>Object</tt>)</span>
&mdash;
<div class='inline'>
<p>Object to generate <span class='object_link'><a href="Pattern.html" title="Hyde::Pattern (class)">Hyde::Pattern</a></span> from</p>
</div>
</li>
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Hyde::Node</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>Parent object to inherit properties to</p>
</div>
</li>
<li>
<span class='name'>setup</span>
<span class='type'>(<tt>#call</tt>)</span>
&mdash;
<div class='inline'>
<p>Setup block</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
27
28
29
30
31
32
33
34
35
36
37
38</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 27</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
<span class='comment'># Child nodes array
</span> <span class='ivar'>@children</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='comment'># Arrays of preprocessors, postprocessors and filters
</span> <span class='ivar'>@preprocessors</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@postprocessors</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@filters</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_binding'>binding</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#Binding-constant" title="Hyde::Path::Binding (constant)">Binding</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
<span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_instance_exec'>instance_exec</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</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="children-instance_method">
#<strong>children</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute children.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
86
87
88</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 86</span>
<span class='kw'>def</span> <span class='id identifier rubyid_children'>children</span>
<span class='ivar'>@children</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="properties-instance_method">
#<strong>properties</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute properties.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
86
87
88</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 86</span>
<span class='kw'>def</span> <span class='id identifier rubyid_properties'>properties</span>
<span class='ivar'>@properties</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="filter-instance_method">
#<strong>filter</strong>(&amp;block) {|request| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a filter to the path. Blocks path access if a filter returns false.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
82
83
84</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 82</span>
<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@filters</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="postprocess-instance_method">
#<strong>postprocess</strong>(&amp;block) {|request, response| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a postprocessor to the path.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
<li>
<span class='name'>response</span>
<span class='type'>(<tt><span class='object_link'><a href="Response.html" title="Hyde::Response (class)">Hyde::Response</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
74
75
76</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 74</span>
<span class='kw'>def</span> <span class='id identifier rubyid_postprocess'>postprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@postprocessors</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="preprocess-instance_method">
#<strong>preprocess</strong>(&amp;block) {|request| ... } &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a preprocessor to the path. Does not modify path execution.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>block</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
<p class="tag_title">Yield Parameters:</p>
<ul class="yieldparam">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
66
67
68</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 66</span>
<span class='kw'>def</span> <span class='id identifier rubyid_preprocess'>preprocess</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='ivar'>@preprocessors</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="process-instance_method">
#<strong>process</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation. Finds the next appropriate path to go to.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>true if further navigation will be done</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>UncaughtThrowError</tt>)</span>
&mdash;
<div class='inline'>
<p>by default throws :response if no matches found.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 44</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_run_filters'>run_filters</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='id identifier rubyid_run_preprocessors'>run_preprocessors</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='id identifier rubyid_enqueue_postprocessors'>enqueue_postprocessors</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='ivar'>@children</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_go'>go</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span>
<span class='id identifier rubyid__die'>_die</span><span class='lparen'>(</span><span class='int'>404</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'>StandardError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid__die'>_die</span><span class='lparen'>(</span><span class='int'>500</span><span class='comma'>,</span> <span class='label'>backtrace:</span> <span class='lbracket'>[</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -87,6 +87,11 @@
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="DSL/PathConstructors.html" title="Hyde::DSL::PathConstructors (module)">DSL::PathConstructors</a></span>, <span class='object_link'><a href="DSL/PathMethods.html" title="Hyde::DSL::PathMethods (module)">DSL::PathMethods</a></span></dd>
</dl>
@ -94,24 +99,143 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde.rb</dd>
<dd>lib/hyde/path.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Protected interface that provides DSL context for setup block.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="ServerBinding.html" title="Hyde::ServerBinding (class)">ServerBinding</a></span></p>
</div>
<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>(path) &#x21d2; PathBinding </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of PathBinding.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="DSL/PathMethods.html" title="Hyde::DSL::PathMethods (module)">DSL::PathMethods</a></span></h3>
<p class="inherited"><span class='object_link'><a href="DSL/PathMethods.html#filter-instance_method" title="Hyde::DSL::PathMethods#filter (method)">#filter</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#index-instance_method" title="Hyde::DSL::PathMethods#index (method)">#index</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#postprocess-instance_method" title="Hyde::DSL::PathMethods#postprocess (method)">#postprocess</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#preprocess-instance_method" title="Hyde::DSL::PathMethods#preprocess (method)">#preprocess</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#remap-instance_method" title="Hyde::DSL::PathMethods#remap (method)">#remap</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#root-instance_method" title="Hyde::DSL::PathMethods#root (method)">#root</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="DSL/PathConstructors.html" title="Hyde::DSL::PathConstructors (module)">DSL::PathConstructors</a></span></h3>
<p class="inherited"><span class='object_link'><a href="DSL/PathConstructors.html#connect-instance_method" title="Hyde::DSL::PathConstructors#connect (method)">#connect</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#delete-instance_method" title="Hyde::DSL::PathConstructors#delete (method)">#delete</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#get-instance_method" title="Hyde::DSL::PathConstructors#get (method)">#get</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#head-instance_method" title="Hyde::DSL::PathConstructors#head (method)">#head</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#options-instance_method" title="Hyde::DSL::PathConstructors#options (method)">#options</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#patch-instance_method" title="Hyde::DSL::PathConstructors#patch (method)">#patch</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#path-instance_method" title="Hyde::DSL::PathConstructors#path (method)">#path</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#post-instance_method" title="Hyde::DSL::PathConstructors#post (method)">#post</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#probe-instance_method" title="Hyde::DSL::PathConstructors#probe (method)">#probe</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#put-instance_method" title="Hyde::DSL::PathConstructors#put (method)">#put</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#register-instance_method" title="Hyde::DSL::PathConstructors#register (method)">#register</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#serve-instance_method" title="Hyde::DSL::PathConstructors#serve (method)">#serve</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#trace-instance_method" title="Hyde::DSL::PathConstructors#trace (method)">#trace</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>(path) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::PathBinding (class)">PathBinding</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of PathBinding.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
15
16
17</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/path.rb', line 15</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -275,13 +275,13 @@
<pre class="lines">
16
17
18
19
20</pre>
19</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 17</span>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
<span class='ivar'>@pattern</span> <span class='op'>=</span> <span class='id identifier rubyid_patternify'>patternify</span><span class='lparen'>(</span><span class='id identifier rubyid_pattern'>pattern</span><span class='rparen'>)</span>
@ -379,6 +379,7 @@
<pre class="lines">
35
36
37
38
@ -389,11 +390,10 @@
43
44
45
46
47</pre>
46</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 36</span>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='ivar'>@pattern</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
@ -471,20 +471,20 @@
<pre class="lines">
52
53
54
55
56
57
58
59</pre>
58</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 53</span>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 52</span>
<span class='kw'>def</span> <span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='ivar'>@pattern</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
<span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="PatternMatching.html" title="Hyde::PatternMatching (module)">PatternMatching</a></span></span><span class='period'>.</span><span class='id identifier rubyid_canonicalize'><span class='object_link'><a href="PatternMatching.html#canonicalize-class_method" title="Hyde::PatternMatching.canonicalize (method)">canonicalize</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span> <span class='id identifier rubyid_pattern'>pattern</span>
<span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="PatternMatching.html" title="Hyde::PatternMatching (module)">PatternMatching</a></span></span><span class='period'>.</span><span class='id identifier rubyid_canonicalize'><span class='object_link'><a href="PatternMatching.html#canonicalize-class_method" title="Hyde::PatternMatching.canonicalize (method)">canonicalize</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span> <span class='ivar'>@pattern</span>
<span class='kw'>else</span>
<span class='ivar'>@pattern</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
<span class='kw'>end</span>
@ -533,12 +533,12 @@
<pre class="lines">
22
23
24
25</pre>
24</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 23</span>
<pre class="code"><span class="info file"># File 'lib/hyde/pattern_matching.rb', line 22</span>
<span class='kw'>def</span> <span class='id identifier rubyid_static?'>static?</span>
<span class='ivar'>@static</span>
@ -553,7 +553,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -232,7 +232,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -641,7 +641,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -559,7 +559,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:24 2023 by
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

471
doc/Hyde/Probe.html Normal file
View File

@ -0,0 +1,471 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Probe
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Probe";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">Probe</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: Hyde::Probe
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next">Hyde::Probe</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Test probe. Also base for all “reactive” nodes.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span>, <span class='object_link'><a href="ServeHandler.html" title="Hyde::ServeHandler (class)">ServeHandler</a></span></p>
</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="#properties-instance_method" title="#properties (instance method)">#<strong>properties</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute properties.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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>(path, parent:) &#x21d2; Probe </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Probe.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</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>(path, parent:) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Probe (class)">Probe</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Probe.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>Object</tt>)</span>
</li>
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Hyde::Node</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
23
24
25</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe.rb', line 23</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</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="properties-instance_method">
#<strong>properties</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute properties.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe.rb', line 27</span>
<span class='kw'>def</span> <span class='id identifier rubyid_properties'>properties</span>
<span class='ivar'>@properties</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="process-instance_method">
#<strong>process</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation. Throws an error upon reaching the path. This behaviour should only be used internally.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>true if further navigation is possible</p>
</div>
</li>
</ul>
<p class="tag_title">Raises:</p>
<ul class="raise">
<li>
<span class='type'>(<tt>StandardError</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
35
36
37
38
39
40
41
42</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe.rb', line 35</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\/?$</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>StandardError</span><span class='comma'>,</span> <span class='heredoc_beg'>&lt;&lt;~STREND</span>
<span class='tstring_content'> probe reached </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_splat'>splat</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>
</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_pretty_inspect'>pretty_inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>
</span><span class='heredoc_end'> STREND
</span><span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

219
doc/Hyde/ProbeBinding.html Normal file
View File

@ -0,0 +1,219 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::ProbeBinding
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::ProbeBinding";
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 (P)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">ProbeBinding</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: Hyde::ProbeBinding
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Hyde::ProbeBinding</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="DSL/ProbeMethods.html" title="Hyde::DSL::ProbeMethods (module)">DSL::ProbeMethods</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/binding.rb</dd>
</dl>
</div>
<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>(origin) &#x21d2; ProbeBinding </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of ProbeBinding.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="DSL/ProbeMethods.html" title="Hyde::DSL::ProbeMethods (module)">DSL::ProbeMethods</a></span></h3>
<p class="inherited"><span class='object_link'><a href="DSL/ProbeMethods.html#bounce-instance_method" title="Hyde::DSL::ProbeMethods#bounce (method)">#bounce</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html#die-instance_method" title="Hyde::DSL::ProbeMethods#die (method)">#die</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html#header-instance_method" title="Hyde::DSL::ProbeMethods#header (method)">#header</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html#remove_header-instance_method" title="Hyde::DSL::ProbeMethods#remove_header (method)">#remove_header</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html#request-instance_method" title="Hyde::DSL::ProbeMethods#request (method)">#request</a></span>, <span class='object_link'><a href="DSL/ProbeMethods.html#status-instance_method" title="Hyde::DSL::ProbeMethods#status (method)">#status</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>(origin) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::ProbeBinding (class)">ProbeBinding</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of ProbeBinding.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
7
8
9</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/binding.rb', line 7</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_origin'>origin</span><span class='rparen'>)</span>
<span class='ivar'>@origin</span> <span class='op'>=</span> <span class='id identifier rubyid_origin'>origin</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

1505
doc/Hyde/Request.html Normal file

File diff suppressed because it is too large Load Diff

1177
doc/Hyde/Response.html Normal file

File diff suppressed because it is too large Load Diff

476
doc/Hyde/ServeHandler.html Normal file
View File

@ -0,0 +1,476 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::ServeHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::ServeHandler";
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 (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">ServeHandler</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: Hyde::ServeHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next">Hyde::ServeHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/serve_handler.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that sends files from a location</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="#response-instance_method" title="#response (instance method)">#<strong>response</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute response.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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>(path, parent:) &#x21d2; ServeHandler </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of ServeHandler.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(request) &#x21d2; Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Method callback on successful request navigation.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</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>(path, parent:) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::ServeHandler (class)">ServeHandler</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of ServeHandler.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>path</span>
<span class='type'>(<tt>Object</tt>)</span>
</li>
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Hyde::Node</a></span></tt>)</span>
</li>
<li>
<span class='name'>exec</span>
<span class='type'>(<tt>#call</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/serve_handler.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</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="response=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="response-instance_method">
#<strong>response</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute response.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/serve_handler.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_response'>response</span>
<span class='ivar'>@response</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="process-instance_method">
#<strong>process</strong>(request) &#x21d2; <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Method callback on successful request navigation. Tries to serve files matched by handler</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>request</span>
<span class='type'>(<tt><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Hyde::Request</a></span></tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
&mdash;
<div class='inline'>
<p>true if file was found</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
22
23
24
25
26
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/probe/serve_handler.rb', line 22</span>
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span> <span class='ivar'>@properties</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>path</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_delete_suffix'>delete_suffix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'>StandardError</span>
<span class='kw'>false</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

441
doc/Hyde/Server.html Normal file
View File

@ -0,0 +1,441 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Server
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Server";
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 (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">Server</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: Hyde::Server
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Path.html" title="Hyde::Path (class)">Path</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Path.html" title="Hyde::Path (class)">Path</a></span></li>
<li class="next">Hyde::Server</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/server.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A specialized path that can be used directly as a Rack application.</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="Binding-constant" class="">Binding =
</dt>
<dd><pre class="code"><span class='const'><span class='object_link'><a href="ServerBinding.html" title="Hyde::ServerBinding (class)">ServerBinding</a></span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Path.html" title="Hyde::Path (class)">Path</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Path.html#children-instance_method" title="Hyde::Path#children (method)">#children</a></span>, <span class='object_link'><a href="Path.html#properties-instance_method" title="Hyde::Path#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</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="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(env) &#x21d2; Array(Integer,Hash,Array) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Rack ingress point.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(parent: nil, &amp;setup) &#x21d2; Server </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Server.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Path.html" title="Hyde::Path (class)">Path</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Path.html#filter-instance_method" title="Hyde::Path#filter (method)">#filter</a></span>, <span class='object_link'><a href="Path.html#postprocess-instance_method" title="Hyde::Path#postprocess (method)">#postprocess</a></span>, <span class='object_link'><a href="Path.html#preprocess-instance_method" title="Hyde::Path#preprocess (method)">#preprocess</a></span>, <span class='object_link'><a href="Path.html#process-instance_method" title="Hyde::Path#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</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>(parent: nil, &amp;setup) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Server (class)">Server</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Server.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Hyde::Node</a></span></tt>, <tt>nil</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>Parent object to inherit properties to</p>
</div>
</li>
<li>
<span class='name'>setup</span>
<span class='type'>(<tt>#<span class='object_link'><a href="#call-instance_method" title="Hyde::Server#call (method)">call</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>Setup block</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/server.rb', line 18</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>parent:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>parent:</span> <span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_setup'>setup</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_parent'>parent</span>
<span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>handle.default</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='label'>backtrace:</span> <span class='kw'>nil</span><span class='op'>|</span>
<span class='id identifier rubyid_page'>page</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Util.html" title="Hyde::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_default_error_page'><span class='object_link'><a href="Util.html#default_error_page-class_method" title="Hyde::Util.default_error_page (method)">default_error_page</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_backtrace'>backtrace</span><span class='rparen'>)</span>
<span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='lbrace'>{</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-length</span><span class='label_end'>&quot;:</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='label_end'>&quot;:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/html</span><span class='tstring_end'>&quot;</span></span>
<span class='rbrace'>}</span>
<span class='lbracket'>[</span><span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span> <span class='id identifier rubyid_page'>page</span><span class='rbracket'>]</span>
<span class='kw'>end</span><span class='comma'>,</span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>path</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span>
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='ivar'>@properties</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span> <span class='kw'>unless</span> <span class='ivar'>@properties</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="call-instance_method">
#<strong>call</strong>(env) &#x21d2; <tt>Array(Integer,Hash,Array)</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Rack ingress point. This should not be called under any circumstances twice in the same application, although server nesting for the purpose of creating virtual hosts is allowed.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>env</span>
<span class='type'>(<tt>Hash</tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array(Integer,Hash,Array)</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
41
42
43
44
45
46
47
48</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/server.rb', line 41</span>
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Request.html" title="Hyde::Request (class)">Request</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Request.html#initialize-instance_method" title="Hyde::Request#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_env'>env</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_catch'>catch</span><span class='lparen'>(</span><span class='symbol'>:finish</span><span class='rparen'>)</span> <span class='kw'>do</span>
<span class='id identifier rubyid_go'>go</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_run_postprocessors'>run_postprocessors</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="Response.html" title="Hyde::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_convert'><span class='object_link'><a href="Response.html#convert-class_method" title="Hyde::Response.convert (method)">convert</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_finalize'>finalize</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

162
doc/Hyde/ServerBinding.html Normal file
View File

@ -0,0 +1,162 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::ServerBinding
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::ServerBinding";
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 (S)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">ServerBinding</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: Hyde::ServerBinding
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></li>
<li class="next">Hyde::ServerBinding</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/server.rb</dd>
</dl>
</div>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="PathBinding.html" title="Hyde::PathBinding (class)">PathBinding</a></span></h3>
<p class="inherited"><span class='object_link'><a href="PathBinding.html#initialize-instance_method" title="Hyde::PathBinding#initialize (method)">#initialize</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="DSL/PathMethods.html" title="Hyde::DSL::PathMethods (module)">DSL::PathMethods</a></span></h3>
<p class="inherited"><span class='object_link'><a href="DSL/PathMethods.html#filter-instance_method" title="Hyde::DSL::PathMethods#filter (method)">#filter</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#index-instance_method" title="Hyde::DSL::PathMethods#index (method)">#index</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#postprocess-instance_method" title="Hyde::DSL::PathMethods#postprocess (method)">#postprocess</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#preprocess-instance_method" title="Hyde::DSL::PathMethods#preprocess (method)">#preprocess</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#remap-instance_method" title="Hyde::DSL::PathMethods#remap (method)">#remap</a></span>, <span class='object_link'><a href="DSL/PathMethods.html#root-instance_method" title="Hyde::DSL::PathMethods#root (method)">#root</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="DSL/PathConstructors.html" title="Hyde::DSL::PathConstructors (module)">DSL::PathConstructors</a></span></h3>
<p class="inherited"><span class='object_link'><a href="DSL/PathConstructors.html#connect-instance_method" title="Hyde::DSL::PathConstructors#connect (method)">#connect</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#delete-instance_method" title="Hyde::DSL::PathConstructors#delete (method)">#delete</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#get-instance_method" title="Hyde::DSL::PathConstructors#get (method)">#get</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#head-instance_method" title="Hyde::DSL::PathConstructors#head (method)">#head</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#options-instance_method" title="Hyde::DSL::PathConstructors#options (method)">#options</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#patch-instance_method" title="Hyde::DSL::PathConstructors#patch (method)">#patch</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#path-instance_method" title="Hyde::DSL::PathConstructors#path (method)">#path</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#post-instance_method" title="Hyde::DSL::PathConstructors#post (method)">#post</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#probe-instance_method" title="Hyde::DSL::PathConstructors#probe (method)">#probe</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#put-instance_method" title="Hyde::DSL::PathConstructors#put (method)">#put</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#register-instance_method" title="Hyde::DSL::PathConstructors#register (method)">#register</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#serve-instance_method" title="Hyde::DSL::PathConstructors#serve (method)">#serve</a></span>, <span class='object_link'><a href="DSL/PathConstructors.html#trace-instance_method" title="Hyde::DSL::PathConstructors#trace (method)">#trace</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="PathBinding.html#initialize-instance_method" title="Hyde::PathBinding#initialize (method)">Hyde::PathBinding</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

221
doc/Hyde/TRACEHandler.html Normal file
View File

@ -0,0 +1,221 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::TRACEHandler
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::TRACEHandler";
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 (T)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">TRACEHandler</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: Hyde::TRACEHandler
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></li>
<li class="next"><span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></li>
<li class="next"><span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></li>
<li class="next"><span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></li>
<li class="next">Hyde::TRACEHandler</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/probe/http_method.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Probe that executes callback on a TRACE</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="METHOD-constant" class="">METHOD =
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TRACE</span><span class='tstring_end'>&quot;</span></span></pre></dd>
</dl>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>, <span class='object_link'><a href="Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>, <span class='object_link'><a href="Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span></p>
<h2>Method Summary</h2>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Handler.html" title="Hyde::Handler (class)">Handler</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Probe.html" title="Hyde::Probe (class)">Probe</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Hyde::Node (class)">Node</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>, <span class='object_link'><a href="Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">Hyde::Handler</a></span></p>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:59 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

487
doc/Hyde/Util.html Normal file
View File

@ -0,0 +1,487 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: Hyde::Util
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Util";
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 (U)</a> &raquo;
<span class='title'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span>
&raquo;
<span class="title">Util</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>Module: Hyde::Util
</h1>
<div class="box_info">
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/util/lookup.rb<span class="defines">,<br />
lib/hyde/util/html.rb,<br /> lib/hyde/util/query.rb</span>
</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Various things that exists for purely logical reasons</p>
</div>
</div>
<div class="tags">
</div><h2>Defined Under Namespace</h2>
<p class="children">
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Util/Lookup.html" title="Hyde::Util::Lookup (class)">Lookup</a></span>, <span class='object_link'><a href="Util/Query.html" title="Hyde::Util::Query (class)">Query</a></span>
</p>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="HTTP_STATUS-constant" class="">HTTP_STATUS =
<div class="docstring">
<div class="discussion">
<p>HTTP status codes and descriptions Taken from WEBrick <a href="https://github.com/ruby/webrick/blob/master/lib/webrick/httpstatus.rb" target="_parent" title="https://github.com/ruby/webrick/blob/master/lib/webrick/httpstatus.rb">https://github.com/ruby/webrick/blob/master/lib/webrick/httpstatus.rb</a></p>
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='lbrace'>{</span>
<span class='int'>100</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Continue</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>101</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Switching Protocols</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>200</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>OK</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>201</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Created</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>202</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Accepted</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>203</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Non-Authoritative Information</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>204</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>No Content</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>205</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Reset Content</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>206</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Partial Content</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>207</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Multi-Status</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>300</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Multiple Choices</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>301</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Moved Permanently</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>302</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Found</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>303</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>See Other</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>304</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Not Modified</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>305</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Use Proxy</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>307</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Temporary Redirect</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>400</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Bad Request</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>401</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Unauthorized</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>402</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Payment Required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>403</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Forbidden</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>404</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Not Found</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>405</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Method Not Allowed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>406</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Not Acceptable</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>407</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Proxy Authentication Required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>408</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Request Timeout</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>409</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Conflict</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>410</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Gone</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>411</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Length Required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>412</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Precondition Failed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>413</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Request Entity Too Large</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>414</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Request-URI Too Large</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>415</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Unsupported Media Type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>416</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Request Range Not Satisfiable</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>417</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Expectation Failed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>422</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Unprocessable Entity</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>423</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Locked</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>424</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Failed Dependency</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>426</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Upgrade Required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>428</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Precondition Required</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>429</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Too Many Requests</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>431</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Request Header Fields Too Large</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>451</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Unavailable For Legal Reasons</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>500</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Internal Server Error</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>501</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Not Implemented</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>502</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Bad Gateway</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>503</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Service Unavailable</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>504</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Gateway Timeout</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>505</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>HTTP Version Not Supported</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>507</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Insufficient Storage</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='int'>511</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Network Authentication Required</span><span class='tstring_end'>&#39;</span></span>
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
</dl>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#default_error_page-class_method" title="default_error_page (class method)">.<strong>default_error_page</strong>(code, backtrace) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Default error page for Hyde.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#escape_html-class_method" title="escape_html (class method)">.<strong>escape_html</strong>(str) &#x21d2; String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Return string with escaped HTML entities.</p>
</div></span>
</li>
</ul>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="default_error_page-class_method">
.<strong>default_error_page</strong>(code, backtrace) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Default error page for Hyde</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>code</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>HTTP Status code</p>
</div>
</li>
<li>
<span class='name'>backtrace</span>
<span class='type'>(<tt>Array(String)</tt>, <tt>nil</tt>)</span>
&mdash;
<div class='inline'>
<p>Message to show in backtrace window</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/html.rb', line 78</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default_error_page'>default_error_page</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_backtrace'>backtrace</span><span class='rparen'>)</span>
<span class='id identifier rubyid_backtrace'>backtrace</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_errortext'>errortext</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#HTTP_STATUS-constant" title="Hyde::Util::HTTP_STATUS (constant)">HTTP_STATUS</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_code'>code</span><span class='rbracket'>]</span>
<span class='heredoc_beg'>&lt;&lt;~HTMLEOF</span>
<span class='tstring_content'> &lt;!DOCTYPE HTML&gt;
</span><span class='tstring_content'> &lt;html&gt;
</span><span class='tstring_content'> &lt;head&gt;
</span><span class='tstring_content'> &lt;title&gt;</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="" title="Hyde::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_escape_html'><span class='object_link'><a href="#escape_html-class_method" title="Hyde::Util.escape_html (method)">escape_html</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_errortext'>errortext</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/title&gt;
</span><span class='tstring_content'> &lt;style&gt; .header {padding: 0.5rem; overflow: auto;} .title { font-weight: bolder; font-size: 48px; margin: 10px 10px; text-shadow: 1px 1px 1px #202222, 2px 2px 2px #404444; float: left } body { margin: 0; } .text { font-size 1rem; } .small { color: #7D7D7D; font-size: 12px;} .code { font-family: monospace; font-size: 0.7rem; } &lt;/style&gt;
</span><span class='tstring_content'> &lt;/head&gt;
</span><span class='tstring_content'> &lt;body&gt;
</span><span class='tstring_content'> &lt;div class=&quot;header&quot;&gt;
</span><span class='tstring_content'> &lt;p class=&quot;title&quot;&gt;HYDE&lt;/p&gt;
</span><span class='tstring_content'> &lt;p style=&quot;float: right&quot;&gt;&lt;a href=&quot;https://adastra7.net/git/yessiest/hyde&quot;&gt;Source code&lt;/a&gt;&lt;/p&gt;
</span><span class='tstring_content'> &lt;/div&gt;
</span><span class='tstring_content'> &lt;div style=&quot;padding: 0.5rem&quot;&gt;
</span><span class='tstring_content'> &lt;p class=&quot;text&quot;&gt;</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="" title="Hyde::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_escape_html'><span class='object_link'><a href="#escape_html-class_method" title="Hyde::Util.escape_html (method)">escape_html</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_errortext'>errortext</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/p&gt;
</span><span class='tstring_content'> &lt;pre&gt;&lt;code class=&quot;text code&quot;&gt;
</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='const'><span class='object_link'><a href="" title="Hyde::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbeg'>:</span><span class='id identifier rubyid_escape_html'>escape_html</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;br/&gt;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
</span><span class='tstring_content'> &lt;/code&gt;&lt;/pre&gt;
</span><span class='tstring_content'> &lt;hr/&gt;
</span><span class='tstring_content'> &lt;p class=&quot;small&quot;&gt;</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="" title="Hyde::Util (module)">Util</a></span></span><span class='period'>.</span><span class='id identifier rubyid_escape_html'><span class='object_link'><a href="#escape_html-class_method" title="Hyde::Util.escape_html (method)">escape_html</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Hyde.html#VLINE-constant" title="Hyde::VLINE (constant)">VLINE</a></span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/p&gt;
</span><span class='tstring_content'> &lt;/div&gt;
</span><span class='tstring_content'> &lt;/body&gt;
</span><span class='tstring_content'> &lt;/html&gt;
</span><span class='heredoc_end'> HTMLEOF
</span><span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="escape_html-class_method">
.<strong>escape_html</strong>(str) &#x21d2; <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return string with escaped HTML entities</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>str</span>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
64
65
66
67
68
69
70</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/html.rb', line 64</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_escape_html'>escape_html</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
<span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;amp;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;lt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;gt;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\&quot;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&#39;</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&amp;#39;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

613
doc/Hyde/Util/Lookup.html Normal file
View File

@ -0,0 +1,613 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Util::Lookup
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Util::Lookup";
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 (L)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Util.html" title="Hyde::Util (module)">Util</a></span></span>
&raquo;
<span class="title">Lookup</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: Hyde::Util::Lookup
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Hyde::Util::Lookup</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/util/lookup.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Value container with recursive lookup</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="#parent-instance_method" title="#parent (instance method)">#<strong>parent</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute parent.</p>
</div></span>
</li>
</ul>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(hash) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Initialize a Lookup from Hash.</p>
</div></span>
</li>
</ul>
<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="#[]-instance_method" title="#[] (instance method)">#<strong>[]</strong>(key) &#x21d2; Object<sup>?</sup> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get a value by key.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#[]=-instance_method" title="#[]= (instance method)">#<strong>[]=</strong>(key, value) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set a value by key.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(parent = nil, hash = {}) &#x21d2; Lookup </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Lookup.</p>
</div></span>
</li>
</ul>
<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>(parent = nil, hash = {}) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Util::Lookup (class)">Lookup</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Lookup.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>parent</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="Hyde::Util::Lookup (class)">Lookup</a></span></tt>, <tt>nil</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
9
10
11
12</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/lookup.rb', line 9</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='ivar'>@parent</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span> <span class='kw'>or</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='ivar'>@storage</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</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="parent=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="parent-instance_method">
#<strong>parent</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute parent.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/lookup.rb', line 34</span>
<span class='kw'>def</span> <span class='id identifier rubyid_parent'>parent</span>
<span class='ivar'>@parent</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="[]-class_method">
.<strong>[]</strong>(hash) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Initialize a Lookup from Hash</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>hash</span>
<span class='type'>(<tt>Hash</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
16
17
18</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/lookup.rb', line 16</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="" title="Hyde::Util::Lookup (class)">Lookup</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Hyde::Util::Lookup#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_hash'>hash</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="[]-instance_method">
#<strong>[]</strong>(key) &#x21d2; <tt>Object</tt><sup>?</sup>
</h3><div class="docstring">
<div class="discussion">
<p>Get a value by key</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>key</span>
<span class='type'>(<tt>#hash</tt>)</span>
&mdash;
<div class='inline'>
<p>key for value</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Object</tt>, <tt>nil</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
23
24
25</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/lookup.rb', line 23</span>
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='ivar'>@storage</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='kw'>or</span> <span class='ivar'>@parent</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="[]=-instance_method">
#<strong>[]=</strong>(key, value) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set a value by key</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>key</span>
<span class='type'>(<tt>#hash</tt>)</span>
&mdash;
<div class='inline'>
<p>key for value</p>
</div>
</li>
<li>
<span class='name'>value</span>
<span class='type'>(<tt>Object</tt>)</span>
&mdash;
<div class='inline'>
<p>value value</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/lookup.rb', line 30</span>
<span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='ivar'>@storage</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

402
doc/Hyde/Util/Query.html Normal file
View File

@ -0,0 +1,402 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Hyde::Util::Query
&mdash; Documentation by YARD 0.9.34
</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 = "Hyde::Util::Query";
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 (Q)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Hyde.html" title="Hyde (module)">Hyde</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Util.html" title="Hyde::Util (module)">Util</a></span></span>
&raquo;
<span class="title">Query</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: Hyde::Util::Query
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Hyde::Util::Query</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/hyde/util/query.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Query string parser</p>
</div>
</div>
<div class="tags">
</div>
<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>(query) &#x21d2; Query </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of Query.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#parse-instance_method" title="#parse (instance method)">#<strong>parse</strong> &#x21d2; Hash </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Better(tm) query parser with Returns a hash with arrays Key semantics:.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#parse_shallow-instance_method" title="#parse_shallow (instance method)">#<strong>parse_shallow</strong> &#x21d2; Hash </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Shallow query parser (does not do PHP-like array keys).</p>
</div></span>
</li>
</ul>
<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>(query) &#x21d2; <tt><span class='object_link'><a href="" title="Hyde::Util::Query (class)">Query</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Query.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>query</span>
<span class='type'>(<tt>String</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
10
11
12</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/query.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
<span class='ivar'>@query</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="parse-instance_method">
#<strong>parse</strong> &#x21d2; <tt>Hash</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Better(tm) query parser with Returns a hash with arrays Key semantics:</p>
<ul><li>
<p>key=value` creates a key value pair</p>
</li><li>
<p>key[]=value` appends `value` to an array named `key`</p>
</li><li>
<p><a href="index">key</a>=value` sets `value` at `index` of array named `key`</p>
</li></ul>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Hash</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/query.rb', line 30</span>
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span>
<span class='id identifier rubyid_construct_deep_hash'>construct_deep_hash</span><span class='lparen'>(</span><span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_decode_www_form'>decode_www_form</span><span class='lparen'>(</span><span class='ivar'>@query</span><span class='comma'>,</span> <span class='const'>Encoding</span><span class='op'>::</span><span class='const'>UTF_8</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="parse_shallow-instance_method">
#<strong>parse_shallow</strong> &#x21d2; <tt>Hash</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Shallow query parser (does not do PHP-like array keys)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Hash</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
16
17
18
19
20</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/hyde/util/query.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_parse_shallow'>parse_shallow</span>
<span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_decode_www_form'>decode_www_form</span><span class='lparen'>(</span><span class='ivar'>@query</span><span class='comma'>,</span> <span class='const'>Encoding</span><span class='op'>::</span><span class='const'>UTF_8</span><span class='rparen'>)</span>
<span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_array'>array</span><span class='op'>|</span> <span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Sat Sep 9 19:10:58 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>
</div>
</body>
</html>

View File

@ -76,10 +76,54 @@
<td valign='top' width="33%">
<ul id="alpha_C" class="alpha">
<li class="letter">C</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/CONNECTHandler.html" title="Hyde::CONNECTHandler (class)">CONNECTHandler</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_D" class="alpha">
<li class="letter">D</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/DELETEHandler.html" title="Hyde::DELETEHandler (class)">DELETEHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/DSL.html" title="Hyde::DSL (module)">DSL</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_G" class="alpha">
<li class="letter">G</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/GETHandler.html" title="Hyde::GETHandler (class)">GETHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/PatternMatching/Glob.html" title="Hyde::PatternMatching::Glob (class)">Glob</a></span>
@ -95,6 +139,20 @@
<li class="letter">H</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/HEADHandler.html" title="Hyde::HEADHandler (class)">HEADHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/Handler.html" title="Hyde::Handler (class)">Handler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span>
@ -104,10 +162,79 @@
</ul>
<ul id="alpha_L" class="alpha">
<li class="letter">L</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/Util/Lookup.html" title="Hyde::Util::Lookup (class)">Lookup</a></span>
<small>(Hyde::Util)</small>
</li>
</ul>
</ul>
<ul id="alpha_N" class="alpha">
<li class="letter">N</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/Node.html" title="Hyde::Node (class)">Node</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_O" class="alpha">
<li class="letter">O</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/OPTIONSHandler.html" title="Hyde::OPTIONSHandler (class)">OPTIONSHandler</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
</td><td valign='top' width="33%">
<ul id="alpha_P" class="alpha">
<li class="letter">P</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/PATCHHandler.html" title="Hyde::PATCHHandler (class)">PATCHHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/POSTHandler.html" title="Hyde::POSTHandler (class)">POSTHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/PUTHandler.html" title="Hyde::PUTHandler (class)">PUTHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/Path.html" title="Hyde::Path (class)">Path</a></span>
@ -122,6 +249,20 @@
</li>
<li>
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html" title="Hyde::DSL::PathConstructors (module)">PathConstructors</a></span>
<small>(Hyde::DSL)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/DSL/PathMethods.html" title="Hyde::DSL::PathMethods (module)">PathMethods</a></span>
<small>(Hyde::DSL)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/Pattern.html" title="Hyde::Pattern (class)">Pattern</a></span>
@ -136,6 +277,42 @@
</li>
<li>
<span class='object_link'><a href="Hyde/Probe.html" title="Hyde::Probe (class)">Probe</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/ProbeBinding.html" title="Hyde::ProbeBinding (class)">ProbeBinding</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html" title="Hyde::DSL::ProbeMethods (module)">ProbeMethods</a></span>
<small>(Hyde::DSL)</small>
</li>
</ul>
</ul>
<ul id="alpha_Q" class="alpha">
<li class="letter">Q</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/Util/Query.html" title="Hyde::Util::Query (class)">Query</a></span>
<small>(Hyde::Util)</small>
</li>
</ul>
</ul>
@ -151,6 +328,79 @@
</li>
<li>
<span class='object_link'><a href="Hyde/Request.html" title="Hyde::Request (class)">Request</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/Response.html" title="Hyde::Response (class)">Response</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_S" class="alpha">
<li class="letter">S</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/ServeHandler.html" title="Hyde::ServeHandler (class)">ServeHandler</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span>
<small>(Hyde)</small>
</li>
<li>
<span class='object_link'><a href="Hyde/ServerBinding.html" title="Hyde::ServerBinding (class)">ServerBinding</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_T" class="alpha">
<li class="letter">T</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/TRACEHandler.html" title="Hyde::TRACEHandler (class)">TRACEHandler</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
<ul id="alpha_U" class="alpha">
<li class="letter">U</li>
<ul>
<li>
<span class='object_link'><a href="Hyde/Util.html" title="Hyde::Util (module)">Util</a></span>
<small>(Hyde)</small>
</li>
</ul>
</ul>
@ -163,7 +413,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:23 2023 by
Generated on Sat Sep 9 19:10:57 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

File diff suppressed because one or more lines are too long

View File

@ -67,108 +67,103 @@
<p>A simple &quot;Hello, World!&quot; HTTP API using Hyde</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Hyde</span><span class='tstring_end'>&#39;</span></span>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/hello</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello, World!</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/hello</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello world!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>A push/pull stack as an HTTP API</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='const'>Stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pull</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/pop</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Several push/pull buckets</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='const'>Stack</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_1</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_2</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_3</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>2</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>3</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_1</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_2</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_3</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pull</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_bucket_name'>bucket_name</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_filepath'>filepath</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>bucket_[^\/]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket_name'>bucket_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_bucket_name'>bucket_name</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_filepath'>filepath</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>bucket_[^\/]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='const'>Stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket_name'>bucket_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_(1|2|3)</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pop</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_bucket'>bucket</span><span class='op'>|</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket'>bucket</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_bucket'>bucket</span><span class='op'>|</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket'>bucket</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Static file serving
(Note: index applies <em>only</em> to /var/www (to the path its defined in))</p>
<pre class="code ruby"><code class="ruby">require &#39;hyde&#39;
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
server = Hyde::Server.new Port:8000 do
path &quot;static&quot; do
root &quot;/var/www&quot;
index [&quot;index.html&quot;,&quot;index.htm&quot;]
serve &quot;*/*.html&quot; safe_regexp: false
serve &quot;*.html&quot;
end
end
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_root'>root</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/var/www</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_index'>index</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index.html</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index.htm</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
<span class='id identifier rubyid_serve'>serve</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>**/*.(html|htm)</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
server.start
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Logging on a particular path</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span><span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unimportant</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>version</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;version&quot;: &quot;the good one&quot;}</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unimportant</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>version</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1337 (the best one)</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>important</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_preprocess'>preprocess</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='comment'># Implement logging logic here
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Client at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_remote_ip'>remote_ip</span><span class='embexpr_end'>}</span><span class='tstring_content'> wanted to access something /important!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>answer</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;answer&quot;:42}</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>important</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_preprocess'>preprocess</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_req'>req</span><span class='op'>|</span>
<span class='comment'># Implement logging logic here
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Client at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>REMOTE_ADDR</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> wanted to access something /important!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>answer</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;answer&quot;:42, &quot;desc&quot;:&quot;something important!&quot;}</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>And a lot more to come (hopefully)</p>
<p>And a lot more to be found in /examples in this repo.</p>
<h1 id="documentation">Documentation</h1>
@ -195,7 +190,7 @@ server.start
</div></div>
<div id="footer">
Generated on Mon Aug 28 22:29:23 2023 by
Generated on Sat Sep 9 19:10:57 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -67,108 +67,103 @@
<p>A simple &quot;Hello, World!&quot; HTTP API using Hyde</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Hyde</span><span class='tstring_end'>&#39;</span></span>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/hello</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello, World!</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/hello</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Hello world!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>A push/pull stack as an HTTP API</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='const'>Stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pull</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/pop</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Several push/pull buckets</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='const'>Stack</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_1</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_2</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_3</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>2</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>3</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span> <span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_1</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_2</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_3</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pull</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_bucket_name'>bucket_name</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_filepath'>filepath</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>bucket_[^\/]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='const'>Stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket_name'>bucket_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_bucket_name'>bucket_name</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_filepath'>filepath</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>bucket_[^\/]*</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='const'>Stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket_name'>bucket_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bucket_(1|2|3)</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pop</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_bucket'>bucket</span><span class='op'>|</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket'>bucket</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_post'>post</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>push</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_bucket'>bucket</span><span class='op'>|</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_stack'>stack</span><span class='lbracket'>[</span><span class='id identifier rubyid_bucket'>bucket</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
<span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Static file serving
(Note: index applies <em>only</em> to /var/www (to the path its defined in))</p>
<pre class="code ruby"><code class="ruby">require &#39;hyde&#39;
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
server = Hyde::Server.new Port:8000 do
path &quot;static&quot; do
root &quot;/var/www&quot;
index [&quot;index.html&quot;,&quot;index.htm&quot;]
serve &quot;*/*.html&quot; safe_regexp: false
serve &quot;*.html&quot;
end
end
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_root'>root</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/var/www</span><span class='tstring_end'>&quot;</span></span>
<span class='id identifier rubyid_index'>index</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index.html</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>index.htm</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
<span class='id identifier rubyid_serve'>serve</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>**/*.(html|htm)</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
server.start
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>Logging on a particular path</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>hyde</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>Port:</span><span class='int'>8000</span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unimportant</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>version</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;version&quot;: &quot;the good one&quot;}</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_app'>app</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Hyde.html" title="Hyde (module)">Hyde</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Hyde/Server.html" title="Hyde::Server (class)">Server</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">new</a></span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unimportant</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>version</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/plain</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1337 (the best one)</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>important</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_preprocess'>preprocess</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='comment'># Implement logging logic here
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Client at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_remote_ip'>remote_ip</span><span class='embexpr_end'>}</span><span class='tstring_content'> wanted to access something /important!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>answer</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ctx'>ctx</span><span class='op'>|</span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;answer&quot;:42}</span><span class='tstring_end'>&#39;</span></span>
<span class='id identifier rubyid_ctx'>ctx</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>important</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_preprocess'>preprocess</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_req'>req</span><span class='op'>|</span>
<span class='comment'># Implement logging logic here
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Client at </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>REMOTE_ADDR</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> wanted to access something /important!</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_get'>get</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>answer</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
<span class='id identifier rubyid_header'>header</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>content-type</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>application/json</span><span class='tstring_end'>&quot;</span></span>
<span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>{&quot;answer&quot;:42, &quot;desc&quot;:&quot;something important!&quot;}</span><span class='tstring_end'>&#39;</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
<span class='id identifier rubyid_run'>run</span> <span class='id identifier rubyid_app'>app</span>
</code></pre>
<p>And a lot more to come (hopefully)</p>
<p>And a lot more to be found in /examples in this repo.</p>
<h1 id="documentation">Documentation</h1>
@ -195,7 +190,7 @@ server.start
</div></div>
<div id="footer">
Generated on Mon Aug 28 22:29:23 2023 by
Generated on Sat Sep 9 19:10:57 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

View File

@ -44,6 +44,70 @@
<ul id="full_list" class="method">
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Lookup.html#[]-class_method" title="Hyde::Util::Lookup.[] (method)">[]</a></span>
<small>Hyde::Util::Lookup</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Lookup.html#[]-instance_method" title="Hyde::Util::Lookup#[] (method)">#[]</a></span>
<small>Hyde::Util::Lookup</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Lookup.html#[]=-instance_method" title="Hyde::Util::Lookup#[]= (method)">#[]=</a></span>
<small>Hyde::Util::Lookup</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#add_header-instance_method" title="Hyde::Response#add_header (method)">#add_header</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#body-instance_method" title="Hyde::Request#body (method)">#body</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#body-instance_method" title="Hyde::Response#body (method)">#body</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#bounce-instance_method" title="Hyde::DSL::ProbeMethods#bounce (method)">#bounce</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Server.html#call-instance_method" title="Hyde::Server#call (method)">#call</a></span>
<small>Hyde::Server</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/Glob.html#can_convert%3F-class_method" title="Hyde::PatternMatching::Glob.can_convert? (method)">can_convert?</a></span>
@ -68,6 +132,262 @@
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#children-instance_method" title="Hyde::Path#children (method)">#children</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#chunk_body-class_method" title="Hyde::Response.chunk_body (method)">chunk_body</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#chunk_size-instance_method" title="Hyde::Response#chunk_size (method)">#chunk_size</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#connect-instance_method" title="Hyde::DSL::PathConstructors#connect (method)">#connect</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#convert-class_method" title="Hyde::Response.convert (method)">convert</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util.html#default_error_page-class_method" title="Hyde::Util.default_error_page (method)">default_error_page</a></span>
<small>Hyde::Util</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#delete-instance_method" title="Hyde::DSL::PathConstructors#delete (method)">#delete</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#delete_header-instance_method" title="Hyde::Response#delete_header (method)">#delete_header</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#die-instance_method" title="Hyde::DSL::ProbeMethods#die (method)">#die</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util.html#escape_html-class_method" title="Hyde::Util.escape_html (method)">escape_html</a></span>
<small>Hyde::Util</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#filepath-instance_method" title="Hyde::Request#filepath (method)">#filepath</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#filter-instance_method" title="Hyde::Path#filter (method)">#filter</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#filter-instance_method" title="Hyde::DSL::PathMethods#filter (method)">#filter</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#finalize-instance_method" title="Hyde::Response#finalize (method)">#finalize</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#get-instance_method" title="Hyde::DSL::PathConstructors#get (method)">#get</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#go-instance_method" title="Hyde::Node#go (method)">#go</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#head-instance_method" title="Hyde::DSL::PathConstructors#head (method)">#head</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#header-instance_method" title="Hyde::DSL::ProbeMethods#header (method)">#header</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#headers-instance_method" title="Hyde::Request#headers (method)">#headers</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#headers-instance_method" title="Hyde::Response#headers (method)">#headers</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#index-instance_method" title="Hyde::DSL::PathMethods#index (method)">#index</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#initialize-instance_method" title="Hyde::Node#initialize (method)">#initialize</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/PathBinding.html#initialize-instance_method" title="Hyde::PathBinding#initialize (method)">#initialize</a></span>
<small>Hyde::PathBinding</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#initialize-instance_method" title="Hyde::Path#initialize (method)">#initialize</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Probe.html#initialize-instance_method" title="Hyde::Probe#initialize (method)">#initialize</a></span>
<small>Hyde::Probe</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Server.html#initialize-instance_method" title="Hyde::Server#initialize (method)">#initialize</a></span>
<small>Hyde::Server</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#initialize-instance_method" title="Hyde::Request#initialize (method)">#initialize</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#initialize-instance_method" title="Hyde::Response#initialize (method)">#initialize</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Query.html#initialize-instance_method" title="Hyde::Util::Query#initialize (method)">#initialize</a></span>
<small>Hyde::Util::Query</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Lookup.html#initialize-instance_method" title="Hyde::Util::Lookup#initialize (method)">#initialize</a></span>
<small>Hyde::Util::Lookup</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/ProbeBinding.html#initialize-instance_method" title="Hyde::ProbeBinding#initialize (method)">#initialize</a></span>
<small>Hyde::ProbeBinding</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Handler.html#initialize-instance_method" title="Hyde::Handler#initialize (method)">#initialize</a></span>
<small>Hyde::Handler</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Pattern.html#initialize-instance_method" title="Hyde::Pattern#initialize (method)">#initialize</a></span>
@ -77,6 +397,14 @@
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/ServeHandler.html#initialize-instance_method" title="Hyde::ServeHandler#initialize (method)">#initialize</a></span>
<small>Hyde::ServeHandler</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/Glob.html#initialize-instance_method" title="Hyde::PatternMatching::Glob#initialize (method)">#initialize</a></span>
<small>Hyde::PatternMatching::Glob</small>
@ -84,7 +412,7 @@
</li>
<li class="even ">
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/ReMatch.html#initialize-instance_method" title="Hyde::PatternMatching::ReMatch#initialize (method)">#initialize</a></span>
<small>Hyde::PatternMatching::ReMatch</small>
@ -92,7 +420,7 @@
</li>
<li class="odd ">
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Pattern.html#match-instance_method" title="Hyde::Pattern#match (method)">#match</a></span>
<small>Hyde::Pattern</small>
@ -100,7 +428,7 @@
</li>
<li class="even ">
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/Glob.html#match-instance_method" title="Hyde::PatternMatching::Glob#match (method)">#match</a></span>
<small>Hyde::PatternMatching::Glob</small>
@ -108,7 +436,7 @@
</li>
<li class="odd ">
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/ReMatch.html#match-instance_method" title="Hyde::PatternMatching::ReMatch#match (method)">#match</a></span>
<small>Hyde::PatternMatching::ReMatch</small>
@ -116,7 +444,7 @@
</li>
<li class="even ">
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Pattern.html#match%3F-instance_method" title="Hyde::Pattern#match? (method)">#match?</a></span>
<small>Hyde::Pattern</small>
@ -124,7 +452,7 @@
</li>
<li class="odd ">
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/Glob.html#match%3F-instance_method" title="Hyde::PatternMatching::Glob#match? (method)">#match?</a></span>
<small>Hyde::PatternMatching::Glob</small>
@ -132,7 +460,7 @@
</li>
<li class="even ">
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/PatternMatching/ReMatch.html#match%3F-instance_method" title="Hyde::PatternMatching::ReMatch#match? (method)">#match?</a></span>
<small>Hyde::PatternMatching::ReMatch</small>
@ -140,6 +468,382 @@
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#options-instance_method" title="Hyde::DSL::PathConstructors#options (method)">#options</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#param-instance_method" title="Hyde::Request#param (method)">#param</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Lookup.html#parent-instance_method" title="Hyde::Util::Lookup#parent (method)">#parent</a></span>
<small>Hyde::Util::Lookup</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Query.html#parse-instance_method" title="Hyde::Util::Query#parse (method)">#parse</a></span>
<small>Hyde::Util::Query</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Util/Query.html#parse_shallow-instance_method" title="Hyde::Util::Query#parse_shallow (method)">#parse_shallow</a></span>
<small>Hyde::Util::Query</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#patch-instance_method" title="Hyde::DSL::PathConstructors#patch (method)">#patch</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#path-instance_method" title="Hyde::Request#path (method)">#path</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#path-instance_method" title="Hyde::DSL::PathConstructors#path (method)">#path</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#path_info-instance_method" title="Hyde::Request#path_info (method)">#path_info</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#pop_state-instance_method" title="Hyde::Request#pop_state (method)">#pop_state</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#post-instance_method" title="Hyde::DSL::PathConstructors#post (method)">#post</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#postprocess-instance_method" title="Hyde::Path#postprocess (method)">#postprocess</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#postprocess-instance_method" title="Hyde::DSL::PathMethods#postprocess (method)">#postprocess</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#postprocessors-instance_method" title="Hyde::Request#postprocessors (method)">#postprocessors</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#preprocess-instance_method" title="Hyde::Path#preprocess (method)">#preprocess</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#preprocess-instance_method" title="Hyde::DSL::PathMethods#preprocess (method)">#preprocess</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#probe-instance_method" title="Hyde::DSL::PathConstructors#probe (method)">#probe</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#process-instance_method" title="Hyde::Node#process (method)">#process</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#process-instance_method" title="Hyde::Path#process (method)">#process</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Probe.html#process-instance_method" title="Hyde::Probe#process (method)">#process</a></span>
<small>Hyde::Probe</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Handler.html#process-instance_method" title="Hyde::Handler#process (method)">#process</a></span>
<small>Hyde::Handler</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/GETHandler.html#process-instance_method" title="Hyde::GETHandler#process (method)">#process</a></span>
<small>Hyde::GETHandler</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/ServeHandler.html#process-instance_method" title="Hyde::ServeHandler#process (method)">#process</a></span>
<small>Hyde::ServeHandler</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Path.html#properties-instance_method" title="Hyde::Path#properties (method)">#properties</a></span>
<small>Hyde::Path</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Probe.html#properties-instance_method" title="Hyde::Probe#properties (method)">#properties</a></span>
<small>Hyde::Probe</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#push_state-instance_method" title="Hyde::Request#push_state (method)">#push_state</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#put-instance_method" title="Hyde::DSL::PathConstructors#put (method)">#put</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#query-instance_method" title="Hyde::Request#query (method)">#query</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#register-instance_method" title="Hyde::DSL::PathConstructors#register (method)">#register</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#reject-instance_method" title="Hyde::Node#reject (method)">#reject</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#remap-instance_method" title="Hyde::Node#remap (method)">#remap</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#remap-instance_method" title="Hyde::DSL::PathMethods#remap (method)">#remap</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#remove_header-instance_method" title="Hyde::DSL::ProbeMethods#remove_header (method)">#remove_header</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Handler.html#request-instance_method" title="Hyde::Handler#request (method)">#request</a></span>
<small>Hyde::Handler</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#request-instance_method" title="Hyde::DSL::ProbeMethods#request (method)">#request</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#request_method-instance_method" title="Hyde::Request#request_method (method)">#request_method</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Handler.html#response-instance_method" title="Hyde::Handler#response (method)">#response</a></span>
<small>Hyde::Handler</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/ServeHandler.html#response-instance_method" title="Hyde::ServeHandler#response (method)">#response</a></span>
<small>Hyde::ServeHandler</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Node.html#root-instance_method" title="Hyde::Node#root (method)">#root</a></span>
<small>Hyde::Node</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathMethods.html#root-instance_method" title="Hyde::DSL::PathMethods#root (method)">#root</a></span>
<small>Hyde::DSL::PathMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#run_postprocessors-instance_method" title="Hyde::Request#run_postprocessors (method)">#run_postprocessors</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#script_name-instance_method" title="Hyde::Request#script_name (method)">#script_name</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#serve-instance_method" title="Hyde::DSL::PathConstructors#serve (method)">#serve</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#server_name-instance_method" title="Hyde::Request#server_name (method)">#server_name</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#server_port-instance_method" title="Hyde::Request#server_port (method)">#server_port</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#server_protocol-instance_method" title="Hyde::Request#server_protocol (method)">#server_protocol</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Request.html#splat-instance_method" title="Hyde::Request#splat (method)">#splat</a></span>
<small>Hyde::Request</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Pattern.html#static%3F-instance_method" title="Hyde::Pattern#static? (method)">#static?</a></span>
@ -148,6 +852,38 @@
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#status-instance_method" title="Hyde::Response#status (method)">#status</a></span>
<small>Hyde::Response</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/ProbeMethods.html#status-instance_method" title="Hyde::DSL::ProbeMethods#status (method)">#status</a></span>
<small>Hyde::DSL::ProbeMethods</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="Hyde/DSL/PathConstructors.html#trace-instance_method" title="Hyde::DSL::PathConstructors#trace (method)">#trace</a></span>
<small>Hyde::DSL::PathConstructors</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="Hyde/Response.html#validate-instance_method" title="Hyde::Response#validate (method)">#validate</a></span>
<small>Hyde::Response</small>
</div>
</li>
</ul>
</div>

View File

@ -100,7 +100,7 @@
</div>
<div id="footer">
Generated on Mon Aug 28 22:29:23 2023 by
Generated on Sat Sep 9 19:10:57 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.34 (ruby-3.0.6).
</div>

21
examples/form/form.ru Normal file
View File

@ -0,0 +1,21 @@
# frozen_string_literal: true
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
require 'hyde'
require 'hyde/util/multipart'
require 'hyde/util/header'
app = Hyde::Server.new do
root ENV["PWD"]
index ["index.html"]
post "/" do
_, opts = Hyde::Util.parse_value(request.headers["content-type"])
puts Hyde::Util::MultipartParser.new(
request.input, opts["boundary"]
).to_h.pretty_inspect
bounce
end
serve "*.html"
end
run app

27
examples/form/index.html Normal file
View File

@ -0,0 +1,27 @@
<!DOCTYPE>
<html>
<head>
<title>Form upload test</title>
<style>
.form { display: flex; flex-direction: column }
</style>
</head>
<body>
<h1>Form upload test</h1>
<hr/>
<p> Please enter the following details: <p>
<form method="post"
class="form"
enctype="multipart/form-data">
<input type="text" name="form_name" placeholder="Name" required>
<input type="text" name="form_company" placeholder="Company" required>
<input type="text" name="form_phone" placeholder="Phone" required>
<textarea name="comment" placeholder="Comment"></textarea>
<input id="form_files" type="file" name="form_files[]" multiple>
<label for="form_files">Attach file</label>
<input type="submit" value="Send form">
</form>
</body>
</html>

1
examples/form/lib Symbolic link
View File

@ -0,0 +1 @@
../../lib

19
examples/query/config.ru Normal file
View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
require_relative 'lib/hyde'
app = Hyde::Server.new do
get "/hello" do
name = request.query["name"]
if name.is_a? String
"Hello #{name.downcase.capitalize}!"
elsif name.is_a? Array
"Hello #{name.map { |x| x.downcase.capitalize }.join(', ')}!"
else
"Hello user!"
end
end
end
run app

1
examples/query/lib Symbolic link
View File

@ -0,0 +1 @@
../../lib

View File

@ -0,0 +1,6 @@
This example illustrates a basic API that responds with "Hello <username>!" and receives arrays and strings as parameter.
P.S. there is at least *one* vulnerability in this exmaple.
If you don't know which one you definitely want to read about XSS before it's too late
(https://owasp.org/www-community/attacks/xss/)

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
require 'uri'
require_relative 'util/query'
module Hyde
# Request wrapper for Rack protocol
@ -11,6 +12,8 @@ module Hyde
@_original_env = env
# Rack environment variable bindings. Should be public and frozen.
init_request_params(env)
# Query parsing
@query = Hyde::Util::Query.new(@query_string)
# Pattern matching parameters. Public, readable, unfrozen.
@param = {}
@splat = []
@ -37,7 +40,13 @@ module Hyde
# Returns request body (if POST data exists)
# @return [nil, String]
def body
@body ||= @rack.input&.gets
@body ||= @rack.input&.read
end
# Returns raw Rack input object
# @return [IO] (May not entirely be compatible with IO, see Rack/SPEC.rdoc)
def input
@rack.input
end
# Push current navigation state (path, splat, param) onto state stack
@ -52,7 +61,7 @@ module Hyde
attr_reader :request_method, :script_name, :path_info, :server_name,
:server_port, :server_protocol, :headers, :param, :splat,
:postprocessors
:postprocessors, :query
attr_accessor :path, :filepath
private
@ -63,6 +72,7 @@ module Hyde
@request_method = env["REQUEST_METHOD"]
@script_name = env["SCRIPT_NAME"]
@path_info = env["PATH_INFO"]
@query_string = env["QUERY_STRING"]
@server_name = env["SERVER_NAME"]
@server_port = env["SERVER_PORT"]
@server_protocol = env["SERVER_PROTOCOL"]
@ -111,10 +121,12 @@ module Hyde
headers = env.filter_map do |name, value|
[name.delete_prefix("HTTP_"), value] if name.start_with?("HTTP_")
end.to_h
headers.merge!({ "CONTENT_TYPE" => env["CONTENT_TYPE"],
"CONTENT_LENGTH" => env["CONTENT_LENGTH"],
headers.merge!({ "CONTENT-TYPE" => env["CONTENT_TYPE"],
"CONTENT-LENGTH" => env["CONTENT_LENGTH"],
"REMOTE_ADDR" => env["REMOTE_ADDR"] })
headers.freeze
headers.transform_keys do |x|
x.downcase.gsub("_", "-") if x.is_a? String
end.freeze
end
end
end

41
lib/hyde/util/header.rb Normal file
View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
require 'uri'
module Hyde
module Util
# Parse parametrized header values
# @param input [String]
# @param sep [String, Regexp]
# @return [Array(String, Hash)]
def self.parse_value(input, sep = ";")
parts = input.split(sep).map { |x| URI.decode_uri_component(x).strip }
base = parts.shift
opts = parts.map do |raw|
key, value = raw.match(/^([^=]*)(?:=(.*)|)\Z/).to_a[1..]
[key, ((value&.match?(/^".*"$/) ? value[1..-2] : value) or true)]
end.to_h
[base, opts]
end
# Construct a parametrized header value
# @param input [String]
# @param opts [Hash]
# @return [String]
def self.make_value(input, opts, sep = ";")
unless input.match?(/^[\w!#$%&'*+-.^_`|~]*=?[^[:cntrl:]\\",;]+$/)
raise StandardError, "input contains invalid characters"
end
output = input
opts.each do |key, value|
output += if value.is_a? String
"#{sep} #{key}=#{value}"
else
"#{sep} #{key}"
end
end
output
end
end
end

View File

@ -58,7 +58,10 @@ module Hyde
511 => 'Network Authentication Required'
}.freeze
# Return string with escaped HTML entities
# Return string with escaped HTML entities.
# @note Do **not** use this to inject untrusted input into JavaScript code
# or CSS style of the page.
# This function is not adequate to prevent string interpolation.
# @param str [String]
# @return [String]
def self.escape_html(str)

165
lib/hyde/util/multipart.rb Normal file
View File

@ -0,0 +1,165 @@
# frozen_string_literal: false
require 'uri'
require 'stringio'
require 'tempfile'
require_relative 'header'
module Hyde
module Util
# Valid element of form data with headers
# @!attribute headers [Hash] headers recevied from form data
# @!attribute name [String] name of the form part
# @!attribute data [String,nil] Data received in the field through form data
# @!attribute filename [String,nil] Original name of the sent file
# @!attribute filetype [String,nil] MIME-type of the file
# @!attribute tempfile [File,nil] Temporary file for storing sent file data.
FormPart = Struct.new(:data, :name, :filename,
:filetype, :tempfile, :headers) do
# Is this form part a file or plain data?
# @return [Boolean]
def file?
!tempfile.nil?
end
# If FormPart is not a file, simplify to string.
# @return [FormPart, String]
def simplify
file? ? self : self.data
end
end
# A very naive implementation of a Multipart form parser.
class MultipartParser
include Hyde::Util::ParserCommon
def initialize(io, boundary)
@input = io.is_a?(String) ? StringIO.new(io) : io
@boundary = boundary
@state = :idle
@data = []
end
# lord forgive me for what i'm about to do
# TODO: replace the god method with a state machine object
# rubocop:disable Metrics/*
# Parse multipart formdata
# @return [Array<FormPart, FormFile>]
def parse
return @data unless @data.empty?
while (line = @input.gets)
case @state
when :idle # waiting for valid boundary
if line == "--#{@boundary}\r\n"
# transition to :headers on valid boundary
@state = :headers
@data.append(FormPart.new(*([nil] * 5), {}))
end
when :headers # after valid boundary - checking for headers
if line == "\r\n"
# prepare form field and transition to :data or :file
@state = file?(@data[-1].headers) ? :file : :data
if @state == :data
setup_data_meta(@data[-1])
else
setup_file_meta(@data[-1])
end
next
end
push_header(line, @data[-1].headers)
when :data, :file # after headers - processing form data
if @data[-1].headers.empty?
# transition to :idle on empty headers
@state = :idle
next
end
if ["--#{@boundary}\r\n", "--#{@boundary}--\r\n"].include? line
# finalize and transition to either :headers or :idle
if @state == :file
@data[-1].tempfile.truncate(@data[-1].tempfile.size - 2)
@data[-1].tempfile.close
else
@data[-1].data.delete_suffix! "\r\n"
end
@state = line == "--#{@boundary}\r\n" ? :headers : :idle
@data.append(FormPart.new(*([nil] * 5), {}))
next
end
if @state == :data
@data[-1].data ||= ""
@data[-1].data << line
else
@data[-1].tempfile << line
end
end
end
@state = :idle
@data.pop
@data.freeze
end
# rubocop:enable Metrics/*
# Return a hash of current form.
# (equivalent to Query.parse but for multipart/form-data)
# @return [Hash]
def to_h
flatten(sort(gen_hash(parse)))
end
private
def gen_hash(array)
hash = {}
array.each do |formpart|
key = formpart.name.to_s
if key.match?(/.*\[\d*\]\Z/)
new_key, index = key.match(/(.*)\[(\d*)\]\Z/).to_a[1..]
hash[new_key] = [] unless hash[new_key]
hash[new_key].append([index, formpart.simplify])
else
hash[key] = formpart.simplify
end
end
hash
end
# Setup file metadata
# @part part [FormPart]
def setup_file_meta(part)
part.name = part.headers.dig("content-disposition", 1, "name")
part.filename = part.headers.dig("content-disposition", 1, "filename")
part.filetype = part.headers["content-type"]
part.tempfile = Tempfile.new
end
# Setup plain metadata
# @part part [FormPart]
def setup_data_meta(part)
part.name = part.headers.dig("content-disposition", 1, "name")
end
# Analyze headers to check if current data part is a file.
# @param headers_hash [Hash]
# @return [Boolean]
def file?(headers_hash)
if headers_hash.dig("content-disposition", 1, "filename") and
headers_hash['content-type']
return true
end
false
end
# Parse a header and append it to headers_hash
# @param line [String]
# @param headers_hash [Hash]
def push_header(line, headers_hash)
return unless line.match(/^[\w!#$%&'*+-.^_`|~]+:.*\r\n$/)
k, v = line.match(/^([\w!#$%&'*+-.^_`|~]+):(.*)\r\n$/).to_a[1..]
headers_hash[k.downcase] = Hyde::Util.parse_value(v)
end
end
end
end

66
lib/hyde/util/query.rb Normal file
View File

@ -0,0 +1,66 @@
# frozen_string_literal: true
require 'uri'
require_relative 'sorting'
module Hyde
module Util
# Query string parser
class Query
include Hyde::Util::ParserCommon
# @param query [String]
def initialize(query)
@query = query
end
# Shallow query parser (does not do PHP-like array keys)
# @return [Hash]
def parse_shallow
URI.decode_www_form(@query, Encoding::UTF_8)
.sort_by { |array| array[0] }
.to_h
end
# Better(tm) query parser with
# Returns a hash with arrays
# Key semantics:
#
# - `key=value` creates a key value pair
# - `key[]=value` appends `value` to an array named `key`
# - `key[index]=value` sets `value` at `index` of array named `key`
# @return [Hash]
def parse
construct_deep_hash(URI.decode_www_form(@query, Encoding::UTF_8))
end
# Get key from query
# @param key [String]
# @return [String,Array]
def [](key)
(@cache ||= parse)[key]
end
private
# Construct a hash with array support
def construct_deep_hash(array)
flatten(sort(group(array)))
end
# Assign values to keys in a new hash and group arrayable keys
def group(array)
hash = {}
array.each do |key, value|
if key.match?(/.*\[\d*\]\Z/)
new_key, index = key.match(/(.*)\[(\d*)\]\Z/).to_a[1..]
hash[new_key] = [] unless hash[new_key]
hash[new_key].append([index, value])
else
hash[key] = value
end
end
hash
end
end
end
end

37
lib/hyde/util/sorting.rb Normal file
View File

@ -0,0 +1,37 @@
# frozen_string_literal: true
module Hyde
module Util
# Internal library for generating form hashes
module ParserCommon
private
# Sort key-value pair arrays
def sort(hash)
hash.filter { |_, v| v.is_a? Array }.each do |_, value|
value.sort_by! { |array| array[0].to_i }
end
hash
end
# Flatten key-value pair arrays
def flatten(hash)
hash.transform_values do |value|
if value.is_a? Array
new_array = []
value.each do |k, v|
if k.match?(/\d+/) and k.to_i < new_array.size
new_array[k.to_i] = v
else
new_array.append(v)
end
end
new_array
else
value
end
end.to_h
end
end
end
end

16
test/Hyde_Util_Query.rb Normal file
View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
require_relative "../lib/hyde/util/query"
require "test/unit"
class TestQuery < Test::Unit::TestCase
include Hyde::Util
def test_query
test1 = Query.new("key1=1&key2=2&key3[]=1&key3[]=2&key3[]=3")
assert_equal({"key1"=>"1","key2"=>"2","key3"=>["1","2","3"]},test1.parse)
test2 = Query.new("key1[1]=1&key1[500]=3&key1[50]=2")
assert_equal({"key1"=>["1","2","3"]},test2.parse)
test3 = Query.new("array[]=1&array[]=2&array[0]=0&array[500]=3")
assert_equal({"array"=>["0","2","3"]},test3.parse)
end
end