sass-site/source/documentation/Sass/Logger/Delayed.html
2018-10-22 14:13:05 -07:00

654 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: Sass::Logger::Delayed
&mdash; Documentation by YARD 0.9.12
</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../../../assets/css/docs.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!Sass/Logger/Delayed.html";
</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 id="header">
<div id="menu">
<a href="../../_index.html">Index (D)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Logger.html" title="Sass::Logger (module)">Logger</a></span></span>
&raquo;
<span class="title">Delayed</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../class_list.html">
Class List
</a>
<a class="full_list_link" id="method_list_link"
href="../../method_list.html">
Method List
</a>
<a class="full_list_link" id="file_list_link"
href="../../file_list.html">
File List
</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Sass::Logger::Delayed
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Base</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Base</a></span></li>
<li class="next">Sass::Logger::Delayed</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">.ruby-sass/lib/sass/logger/delayed.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A logger that delays messages until they&#39;re explicitly flushed to an
inner logger.</p>
<p>This can be installed around the current logger by calling #install!, and
the original logger can be replaced by calling <span class='object_link'><a href="#uninstall!-instance_method" title="Sass::Logger::Delayed#uninstall! (method)">#uninstall!</a></span>. The log
messages can be flushed by calling <span class='object_link'><a href="#flush-instance_method" title="Sass::Logger::Delayed#flush (method)">#flush</a></span>.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Base</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Base.html#disabled-instance_method" title="Sass::Logger::Base#disabled (method)">#disabled</a></span>, <span class='object_link'><a href="Base.html#io-instance_method" title="Sass::Logger::Base#io (method)">#io</a></span>, <span class='object_link'><a href="Base.html#log_level-instance_method" title="Sass::Logger::Base#log_level (method)">#log_level</a></span></p>
<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="#install!-class_method" title="install! (class method)">.<strong>install!</strong> &#x21d2; Sass::Logger::Delayed </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Installs a new delayed logger as the current Sass logger, wrapping the
original logger.</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="#_log-instance_method" title="#_log (instance method)">#<strong>_log</strong>(level, message) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#flush-instance_method" title="#flush (instance method)">#<strong>flush</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Flushes all queued logs to the wrapped logger.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(inner) &#x21d2; Delayed </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Creates a delayed logger wrapping `inner`.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#uninstall!-instance_method" title="#uninstall! (instance method)">#<strong>uninstall!</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Uninstalls this logger from <span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">Sass.logger</a></span>.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Base</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Base.html#capture-instance_method" title="Sass::Logger::Base#capture (method)">#capture</a></span>, <span class='object_link'><a href="Base.html#log-instance_method" title="Sass::Logger::Base#log (method)">#log</a></span>, <span class='object_link'><a href="Base.html#logging_level%3F-instance_method" title="Sass::Logger::Base#logging_level? (method)">#logging_level?</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="LogLevel.html" title="Sass::Logger::LogLevel (module)">LogLevel</a></span></h3>
<p class="inherited"><span class='object_link'><a href="LogLevel.html#included-class_method" title="Sass::Logger::LogLevel.included (method)">included</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>(inner) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Logger::Delayed (class)">Delayed</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Creates a delayed logger wrapping `inner`.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>inner</span>
<span class='type'>(<tt><span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Sass::Logger::Base</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The wrapped logger.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
25
26
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/logger/delayed.rb', line 25</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span>
<span class='ivar'>@inner</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span>
<span class='ivar'>@messages</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<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>(inner) &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Logger::Delayed (class)">Delayed</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Creates a delayed logger wrapping `inner`.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>inner</span>
<span class='type'>(<tt><span class='object_link'><a href="Base.html" title="Sass::Logger::Base (class)">Sass::Logger::Base</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The wrapped logger.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
25
26
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/logger/delayed.rb', line 25</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span>
<span class='ivar'>@inner</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span>
<span class='ivar'>@messages</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</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="install!-class_method">
.<strong>install!</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Sass::Logger::Delayed (class)">Sass::Logger::Delayed</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Installs a new delayed logger as the current Sass logger, wrapping the
original logger.</p>
<p>This can be undone by calling <span class='object_link'><a href="#uninstall!-instance_method" title="Sass::Logger::Delayed#uninstall! (method)">#uninstall!</a></span>.</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="" title="Sass::Logger::Delayed (class)">Sass::Logger::Delayed</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>The newly-created logger.</p>
</div>
</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 '.ruby-sass/lib/sass/logger/delayed.rb', line 16</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_install!'>install!</span>
<span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Logger.html" title="Sass::Logger (module)">Logger</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Sass::Logger::Delayed (class)">Delayed</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Sass::Logger::Delayed#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">logger</a></span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">logger</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_logger'>logger</span>
<span class='id identifier rubyid_logger'>logger</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="_log-instance_method">
#<strong>_log</strong>(level, message) &#x21d2; <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
47
48
49</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/logger/delayed.rb', line 47</span>
<span class='kw'>def</span> <span class='id identifier rubyid__log'>_log</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
<span class='ivar'>@messages</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="flush-instance_method">
#<strong>flush</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Flushes all queued logs to the wrapped logger.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
32
33
34</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/logger/delayed.rb', line 32</span>
<span class='kw'>def</span> <span class='id identifier rubyid_flush'>flush</span>
<span class='ivar'>@messages</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span><span class='comma'>,</span> <span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span><span class='op'>|</span> <span class='ivar'>@inner</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span><span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span><span class='comma'>,</span> <span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="uninstall!-instance_method">
#<strong>uninstall!</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Uninstalls this logger from <span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">Sass.logger</a></span>. This should only be called if
the logger was installed using #install!</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
38
39
40
41
42
43
44
45</pre>
</td>
<td>
<pre class="code"><span class="info file"># File '.ruby-sass/lib/sass/logger/delayed.rb', line 38</span>
<span class='kw'>def</span> <span class='id identifier rubyid_uninstall!'>uninstall!</span>
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">logger</a></span></span> <span class='op'>!=</span> <span class='kw'>self</span>
<span class='id identifier rubyid_throw'>throw</span> <span class='const'>Exception</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Can&#39;t uninstall a logger that&#39;s not currently installed.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='ivar'>@inner</span><span class='period'>.</span><span class='id identifier rubyid_log_level'>log_level</span> <span class='op'>=</span> <span class='id identifier rubyid_log_level'>log_level</span>
<span class='const'><span class='object_link'><a href="../../Sass.html" title="Sass (module)">Sass</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../../Sass.html#logger-class_method" title="Sass.logger (method)">logger</a></span></span> <span class='op'>=</span> <span class='ivar'>@inner</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Oct 22 13:20:52 2018 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.12 (ruby-2.5.3).
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-535380-14', 'sass-lang.com');
ga('send', 'pageview');
</script>
</body>
</html>