docs/ExceptionHunter/ErrorReaper.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: ExceptionHunter::ErrorReaper
— Documentation by YARD 0.9.26
</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 = "ExceptionHunter::ErrorReaper";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (E)</a> »
<span class='title'><span class='object_link'><a href="../ExceptionHunter.html" title="ExceptionHunter (module)">ExceptionHunter</a></span></span>
»
<span class="title">ErrorReaper</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: ExceptionHunter::ErrorReaper
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">ExceptionHunter::ErrorReaper</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/exception_hunter/error_reaper.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Class in charge of disposing of stale errors as specified in the <span class='object_link'><a href="Config.html" title="ExceptionHunter::Config (class)">Config</a></span>.</p>
</div>
</div>
<div class="tags">
</div>
<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="#purge-class_method" title="purge (class method)">.<strong>purge</strong>(stale_time: Config.errors_stale_time) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Destroys all stale errors.</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="purge-class_method">
.<strong>purge</strong>(stale_time: Config.errors_stale_time)
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p>
<p>Destroys all stale errors.</p>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="ExceptionHunter::ErrorReaper (class)">ErrorReaper</a></span></span><span class='period'>.</span><span class='id identifier rubyid_purge'>purge</span><span class='lparen'>(</span><span class='label'>stale_time:</span> <span class='int'>30</span><span class='period'>.</span><span class='id identifier rubyid_days'>days</span><span class='rparen'>)</span></code></pre>
</div>
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>stale_time</span>
<span class='type'>(<tt>Numeric</tt>)</span>
<em class="default">(defaults to: <tt>Config.errors_stale_time</tt>)</em>
—
<div class='inline'>
<p>considered when destroying errors</p>
</div>
</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/exception_hunter/error_reaper.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_purge'>purge</span><span class='lparen'>(</span><span class='label'>stale_time:</span> <span class='const'><span class='object_link'><a href="Config.html" title="ExceptionHunter::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_errors_stale_time'><span class='object_link'><a href="Config.html#errors_stale_time-instance_method" title="ExceptionHunter::Config#errors_stale_time (method)">errors_stale_time</a></span></span><span class='rparen'>)</span>
<span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_transaction'>transaction</span> <span class='kw'>do</span>
<span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_with_occurrences_before'>with_occurrences_before</span><span class='lparen'>(</span><span class='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_today'>today</span> <span class='op'>-</span> <span class='id identifier rubyid_stale_time'>stale_time</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_destroy_all'>destroy_all</span>
<span class='const'>ErrorGroup</span><span class='period'>.</span><span class='id identifier rubyid_without_errors'>without_errors</span><span class='period'>.</span><span class='id identifier rubyid_destroy_all'>destroy_all</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri Jul 30 14:46:20 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.6.5).
</div>
</div>
</body>
</html>