diff options
| author | realtradam <[email protected]> | 2022-02-03 04:18:07 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-02-03 04:18:07 -0500 |
| commit | 866ed5e2ca86d2f780492f01c30b3350037d3f7c (patch) | |
| tree | f298a64b860b1d1ef64f4f3dae7c9670aa12a257 /docs/FelFlame/ComponentManager.html | |
| parent | 1e9ee993f6f996352c797d9f9a4268e5a7c2f513 (diff) | |
| download | FelECS-866ed5e2ca86d2f780492f01c30b3350037d3f7c.tar.gz FelECS-866ed5e2ca86d2f780492f01c30b3350037d3f7c.zip | |
added new group method for entity managerv5.0.1
Diffstat (limited to 'docs/FelFlame/ComponentManager.html')
| -rw-r--r-- | docs/FelFlame/ComponentManager.html | 1239 |
1 files changed, 0 insertions, 1239 deletions
diff --git a/docs/FelFlame/ComponentManager.html b/docs/FelFlame/ComponentManager.html deleted file mode 100644 index 19891af..0000000 --- a/docs/FelFlame/ComponentManager.html +++ /dev/null @@ -1,1239 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::ComponentManager - - — 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 = "FelFlame::ComponentManager"; - 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> » - <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span> - » - <span class="title">ComponentManager</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: FelFlame::ComponentManager - - - -</h1> -<div class="box_info"> - - <dl> - <dt>Inherits:</dt> - <dd> - <span class="inheritName">Object</span> - - <ul class="fullTree"> - <li>Object</li> - - <li class="next">FelFlame::ComponentManager</li> - - </ul> - <a href="#" class="inheritanceTree">show all</a> - - </dd> - </dl> - - - - - - - - - - - - <dl> - <dt>Defined in:</dt> - <dd>lib/felflame/component_manager.rb</dd> - </dl> - -</div> - -<h2>Overview</h2><div class="docstring"> - <div class="discussion"> - -<p>Component Managers are what is used to create individual components which can be attached to entities. When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g <tt>@component.var = 5</tt>), or by using the <span class='object_link'><a href="#to_h-instance_method" title="FelFlame::ComponentManager#to_h (method)">#to_h</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelFlame::ComponentManager#update_attrs (method)">#update_attrs</a></span> methods instead.</p> - - - </div> -</div> -<div class="tags"> - - -</div> - - - - <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> - <ul class="summary"> - - <li class="public "> - <span class="summary_signature"> - - <a href="#addition_triggers-class_method" title="addition_triggers (class method)">.<strong>addition_triggers</strong> ⇒ Array<System> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when this component is added to an enitity.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#attr_triggers-class_method" title="attr_triggers (class method)">.<strong>attr_triggers</strong> ⇒ Hash<Symbol, System> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when an attribute from this component changed.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#removal_triggers-class_method" title="removal_triggers (class method)">.<strong>removal_triggers</strong> ⇒ Array<System> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when this component is removed from an enitity.</p> -</div></span> - -</li> - - - </ul> - - <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="#addition_triggers-instance_method" title="#addition_triggers (instance method)">#<strong>addition_triggers</strong> ⇒ Array<System> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when a component from this manager is added.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#attr_triggers-instance_method" title="#attr_triggers (instance method)">#<strong>attr_triggers</strong> ⇒ Hash<Symbol, Array<System>> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when an attribute from this manager is changed.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#removal_triggers-instance_method" title="#removal_triggers (instance method)">#<strong>removal_triggers</strong> ⇒ Array<System> </a> - - - - </span> - - - - - <span class="note title readonly">readonly</span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Stores references to systems that should be triggered when a component from this manager is removed.</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="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Boolean </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its data.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> ⇒ Array<Component> </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Entities that have this component.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#entity-instance_method" title="#entity (instance method)">#<strong>entity</strong> ⇒ Component </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>A single entity.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**attrs) ⇒ Component </a> - - - - </span> - - - <span class="note title constructor">constructor</span> - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Creates a new component and sets the values of the attributes given to it.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> ⇒ Hash<Symbol, Value> </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>A hash, where all the keys are attributes storing their respective values.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) ⇒ Hash<Symbol, Value> </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Update attribute values using a hash or keywords.</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>(**attrs) ⇒ <tt>Component</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default.</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>attrs</span> - - - <span class='type'>(<tt>Keyword: Value</tt>)</span> - - - - — - <div class='inline'> -<p>You can pass any number of Keyword-Value pairs</p> -</div> - - </li> - -</ul> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 132</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span> - <span class='comment'># Prepare the object -</span> <span class='comment'># (this is a function created with metaprogramming -</span> <span class='comment'># in FelFlame::Components) -</span> <span class='id identifier rubyid_set_defaults'>set_defaults</span> - - <span class='comment'># Fill params -</span> <span class='id identifier rubyid_attrs'>attrs</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_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> - <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>end</span> - - <span class='comment'># Save Component -</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - -</div> - - <div id="class_attr_details" class="attr_details"> - <h2>Class Attribute Details</h2> - - - <span id="addition_triggers=-class_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="addition_triggers-class_method"> - - .<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when this component is added to an enitity. Do not edit this array as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Array<System></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -180 -181 -182</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 180</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span> - <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - - <span id="attr_triggers=-class_method"></span> - <div class="method_details "> - <h3 class="signature " id="attr_triggers-class_method"> - - .<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, System></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when an attribute from this component changed. Do not edit this hash as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Hash<Symbol, System></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -196 -197 -198</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 196</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span> - <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - - <span id="removal_triggers=-class_method"></span> - <div class="method_details "> - <h3 class="signature " id="removal_triggers-class_method"> - - .<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when this component is removed from an enitity. Do not edit this array as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Array<System></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -188 -189 -190</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 188</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span> - <span class='ivar'>@removal_triggers</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="instance_attr_details" class="attr_details"> - <h2>Instance Attribute Details</h2> - - - <span id="addition_triggers=-instance_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="addition_triggers-instance_method"> - - #<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when a component from this manager is added. Do not edit this array as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Array<System></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -109 -110 -111</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 109</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span> - <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - - <span id="attr_triggers=-instance_method"></span> - <div class="method_details "> - <h3 class="signature " id="attr_triggers-instance_method"> - - #<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, Array<System>></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when an attribute from this manager is changed. Do not edit this hash as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Hash<Symbol, Array<System>></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -125 -126 -127</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 125</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span> - <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - - <span id="removal_triggers=-instance_method"></span> - <div class="method_details "> - <h3 class="signature " id="removal_triggers-instance_method"> - - #<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Stores references to systems that should be triggered when a component from this manager is removed. Do not edit this array as it is managed by FelFlame automatically.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Array<System></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -117 -118 -119</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 117</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span> - <span class='ivar'>@removal_triggers</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="instance_method_details" class="method_details_list"> - <h2>Instance Method Details</h2> - - - <div class="method_details first"> - <h3 class="signature first" id="delete-instance_method"> - - #<strong>delete</strong> ⇒ <tt>Boolean</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its data.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Boolean</tt>)</span> - - - - — - <div class='inline'> -<p><code>true</code>.</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 247</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> - <span class='id identifier rubyid_addition_triggers'>addition_triggers</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_system'>system</span><span class='op'>|</span> - <span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='label'>component_or_manager:</span> <span class='kw'>self</span> - <span class='kw'>end</span> - <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_entity'>entity</span><span class='op'>|</span> - <span class='id identifier rubyid_entity'>entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='kw'>self</span> - <span class='kw'>end</span> - <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid__data'>_data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span> - <span class='id identifier rubyid_instance_variables'>instance_variables</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_var'>var</span><span class='op'>|</span> - <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span> - <span class='kw'>end</span> - <span class='kw'>true</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="entities-instance_method"> - - #<strong>entities</strong> ⇒ <tt>Array<Component></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Entities that have this component</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Array<Component></tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -209 -210 -211</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 209</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span> - <span class='ivar'>@entities</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="entity-instance_method"> - - #<strong>entity</strong> ⇒ <tt>Component</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>A single entity. Use this if you expect the component to only belong to one entity and you want to access it.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Component</tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -215 -216 -217 -218 -219 -220 -221 -222</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 215</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_entity'>entity</span> - <span class='kw'>if</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> - <span class='const'>Warning</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This component belongs to NO entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> - <span class='kw'>elsif</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>1</span> - <span class='const'>Warning</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This component belongs to MANY entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> - <span class='kw'>end</span> - <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="to_h-instance_method"> - - #<strong>to_h</strong> ⇒ <tt>Hash<Symbol, Value></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns A hash, where all the keys are attributes storing their respective values.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> - - - - — - <div class='inline'> -<p>A hash, where all the keys are attributes storing their respective values.</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -262 -263 -264 -265 -266 -267 -268</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 262</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span> - <span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span> - <span class='id identifier rubyid_final'>final</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_delete_prefix'>delete_prefix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> - <span class='kw'>end</span> - <span class='id identifier rubyid_return_hash'>return_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:attr_triggers</span><span class='rparen'>)</span> - <span class='id identifier rubyid_return_hash'>return_hash</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="update_attrs-instance_method"> - - #<strong>update_attrs</strong>(**opts) ⇒ <tt>Hash<Symbol, Value></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Update attribute values using a hash or keywords.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> - - - - — - <div class='inline'> -<p>Hash of updated attributes</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -226 -227 -228 -229 -230</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'lib/felflame/component_manager.rb', line 226</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> - <span class='id identifier rubyid_opts'>opts</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_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> - <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - -</div> - - <div id="footer"> - Generated on Mon Jan 3 08:23:04 2022 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.3). -</div> - - </div> - </body> -</html>
\ No newline at end of file |
