mhenrixon/sidekiq-unique-jobs

View on GitHub
doc/SidekiqUniqueJobs/Reflections.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Class: SidekiqUniqueJobs::Reflections
  
    &mdash; 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 = "SidekiqUniqueJobs::Reflections";
  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 (R)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span>
     &raquo; 
    <span class="title">Reflections</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: SidekiqUniqueJobs::Reflections
  
  
  
</h1>
<div class="box_info">
  
  <dl>
    <dt>Inherits:</dt>
    <dd>
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">SidekiqUniqueJobs::Reflections</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
    </dd>
  </dl>
  

  
  
  
  
  

  

  
  <dl>
    <dt>Defined in:</dt>
    <dd>lib/sidekiq_unique_jobs/reflections.rb</dd>
  </dl>
  
</div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Class NotificationCollection provides a collection with known notifications</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Author:</p>
<ul class="author">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>Mikael Henriksson <a href="mailto:mikael@mhenrixon.com">mikael@mhenrixon.com</a></p>
</div>
      
    </li>
  
</ul>

</div>
  
    <h2>
      Constant Summary
      <small><a href="#" class="constants_summary_toggle">collapse</a></small>
    </h2>

    <dl class="constants">
      
        <dt id="REFLECTIONS-constant" class="">REFLECTIONS =
          <div class="docstring">
  <div class="discussion">
    <p>Returns list of notifications.</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="../Array.html" title="Array (class)">Array</a></span>&lt;Symbol&gt;</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>list of notifications</p>
</div>
      
    </li>
  
</ul>

</div>
        </dt>
        <dd><pre class="code"><span class='lbracket'>[</span>
  <span class='symbol'>:after_unlock_callback_failed</span><span class='comma'>,</span>
  <span class='symbol'>:debug</span><span class='comma'>,</span>
  <span class='symbol'>:duplicate</span><span class='comma'>,</span>
  <span class='symbol'>:error</span><span class='comma'>,</span>
  <span class='symbol'>:execution_failed</span><span class='comma'>,</span>
  <span class='symbol'>:lock_failed</span><span class='comma'>,</span>
  <span class='symbol'>:locked</span><span class='comma'>,</span>
  <span class='symbol'>:reschedule_failed</span><span class='comma'>,</span>
  <span class='symbol'>:rescheduled</span><span class='comma'>,</span>
  <span class='symbol'>:timeout</span><span class='comma'>,</span>
  <span class='symbol'>:unknown_sidekiq_worker</span><span class='comma'>,</span>
  <span class='symbol'>:unlock_failed</span><span class='comma'>,</span>
  <span class='symbol'>:unlocked</span><span class='comma'>,</span>
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
      
        <dt id="DEPRECATIONS-constant" class="">DEPRECATIONS =
          <div class="docstring">
  <div class="discussion">
    <p>Returns a hash with deprecated notifications.</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="../Hash.html" title="Hash (class)">Hash</a></span>&lt;Symbol, <span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span>&lt;Symbol, String&gt;&gt;</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a hash with deprecated notifications</p>
</div>
      
    </li>
  
</ul>

</div>
        </dt>
        <dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
      
    </dl>
  







  
    <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="#configured%3F-instance_method" title="#configured? (instance method)">#<strong>configured?</strong>(reflection)  &#x21d2; Boolean </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#dispatch-instance_method" title="#dispatch (instance method)">#<strong>dispatch</strong>(reflection, *args)  &#x21d2; void </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Dispatch a reflected event.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>  &#x21d2; Reflections </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>A new instance of Reflections.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#misconfigured%3F-instance_method" title="#misconfigured? (instance method)">#<strong>misconfigured?</strong>(reflection)  &#x21d2; Boolean </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></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>  &#x21d2; <tt><span class='object_link'><a href="" title="SidekiqUniqueJobs::Reflections (class)">Reflections</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns a new instance of Reflections.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/reflections.rb', line 41</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
  <span class='ivar'>@reflections</span> <span class='op'>=</span> <span class='lbrace'>{</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="configured?-instance_method">
  
    #<strong>configured?</strong>(reflection)  &#x21d2; <tt>Boolean</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<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">


71
72
73</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/reflections.rb', line 71</span>

<span class='kw'>def</span> <span class='id identifier rubyid_configured?'>configured?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
  <span class='const'><span class='object_link'><a href="#REFLECTIONS-constant" title="SidekiqUniqueJobs::Reflections::REFLECTIONS (constant)">REFLECTIONS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="dispatch-instance_method">
  
    #<strong>dispatch</strong>(reflection, *args)  &#x21d2; <tt>void</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Dispatch a reflected event</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>reflection</span>
      
      
        <span class='type'>(<tt>reflection</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the reflected event</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>args</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the arguments to provide to the block</p>
</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/reflections.rb', line 53</span>

<span class='kw'>def</span> <span class='id identifier rubyid_dispatch'>dispatch</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span> <span class='op'>=</span> <span class='ivar'>@reflections</span><span class='lbracket'>[</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rbracket'>]</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>

    <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="#DEPRECATIONS-constant" title="SidekiqUniqueJobs::Reflections::DEPRECATIONS (constant)">DEPRECATIONS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_replacement'>replacement</span><span class='comma'>,</span> <span class='id identifier rubyid_removal_version'>removal_version</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#DEPRECATIONS-constant" title="SidekiqUniqueJobs::Reflections::DEPRECATIONS (constant)">DEPRECATIONS</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rbracket'>]</span>
      <span class='const'><span class='object_link'><a href="../SidekiqUniqueJobs.html" title="SidekiqUniqueJobs (module)">SidekiqUniqueJobs</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Deprecation.html" title="SidekiqUniqueJobs::Deprecation (class)">Deprecation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'><span class='object_link'><a href="Deprecation.html#warn-class_method" title="SidekiqUniqueJobs::Deprecation.warn (method)">warn</a></span></span><span class='lparen'>(</span>
        <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_reflection'>reflection</span><span class='embexpr_end'>}</span><span class='tstring_content'> is deprecated and will be removed in version </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_removal_version'>removal_version</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span> \
        <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> Use </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_replacement'>replacement</span><span class='embexpr_end'>}</span><span class='tstring_content'> instead.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
      <span class='rparen'>)</span>
    <span class='kw'>end</span>
  <span class='kw'>elsif</span> <span class='id identifier rubyid_misconfigured?'>misconfigured?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="NoSuchNotificationError.html" title="SidekiqUniqueJobs::NoSuchNotificationError (class)">NoSuchNotificationError</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_reflection'>reflection</span>
  <span class='kw'>end</span>

  <span class='kw'>nil</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="misconfigured?-instance_method">
  
    #<strong>misconfigured?</strong>(reflection)  &#x21d2; <tt>Boolean</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<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">


75
76
77</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/sidekiq_unique_jobs/reflections.rb', line 75</span>

<span class='kw'>def</span> <span class='id identifier rubyid_misconfigured?'>misconfigured?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
  <span class='op'>!</span><span class='id identifier rubyid_configured?'>configured?</span><span class='lparen'>(</span><span class='id identifier rubyid_reflection'>reflection</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Mon Sep 27 15:29:08 2021 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.26 (ruby-3.0.2).
</div>

    </div>
  </body>
</html>