summaryrefslogtreecommitdiffhomepage
path: root/docs/FelFlame/Helper/ComponentManager.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/FelFlame/Helper/ComponentManager.html')
-rw-r--r--docs/FelFlame/Helper/ComponentManager.html338
1 files changed, 169 insertions, 169 deletions
diff --git a/docs/FelFlame/Helper/ComponentManager.html b/docs/FelFlame/Helper/ComponentManager.html
index c1d0452..acb1cf8 100644
--- a/docs/FelFlame/Helper/ComponentManager.html
+++ b/docs/FelFlame/Helper/ComponentManager.html
@@ -184,7 +184,7 @@
<li class="public ">
<span class="summary_signature">
- <a href="#each-class_method" title="each (class method)">.<strong>each</strong> &#x21d2; Enumerator </a>
+ <a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&amp;block) &#x21d2; Enumerator </a>
@@ -205,10 +205,19 @@
</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="#new-class_method" title="new (class method)">.<strong>new</strong>(**attrs) &#x21d2; Component </a>
+ <a href="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> &#x21d2; Hash </a>
@@ -223,25 +232,16 @@
<span class="summary_desc"><div class='inline'>
-<p>Creates a new component and sets the values of the attributes given to it.</p>
+<p>A hash, where all the keys are attributes linked to their respective values.</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="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> &#x21d2; Hash </a>
+ <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> &#x21d2; Boolean </a>
@@ -256,7 +256,7 @@
<span class="summary_desc"><div class='inline'>
-<p>A hash, where all the keys are attributes linked to their respective values.</p>
+<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Helper::ComponentManager#id (method)">ID</a></span> and data.</p>
</div></span>
</li>
@@ -265,7 +265,7 @@
<li class="public ">
<span class="summary_signature">
- <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> &#x21d2; Boolean </a>
+ <a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> &#x21d2; Array&lt;Integer&gt; </a>
@@ -280,7 +280,7 @@
<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 <span class='object_link'><a href="#id-instance_method" title="FelFlame::Helper::ComponentManager#id (method)">ID</a></span> and data.</p>
+<p>A list of entity ids that are linked to the component.</p>
</div></span>
</li>
@@ -289,13 +289,15 @@
<li class="public ">
<span class="summary_signature">
- <a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> &#x21d2; Array </a>
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**attrs) &#x21d2; Component </a>
</span>
+ <span class="note title constructor">constructor</span>
+
@@ -304,7 +306,7 @@
<span class="summary_desc"><div class='inline'>
-<p>A list of components that are linked to the component.</p>
+<p>Creates a new component and sets the values of the attributes given to it.</p>
</div></span>
</li>
@@ -385,6 +387,103 @@
</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) &#x21d2; <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>
+
+
+
+ &mdash;
+ <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">
+
+
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 62</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'># Generate ID
+</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</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_find_index'>find_index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
+ <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</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_size'>size</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_id'>new_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
+ <span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</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'>&quot;</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'>&quot;</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_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_new_id'>new_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</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>
@@ -430,12 +529,12 @@
<pre class="lines">
-53
-54
-55</pre>
+57
+58
+59</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 53</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 57</span>
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
<span class='ivar'>@id</span>
@@ -520,12 +619,12 @@
<pre class="lines">
-69
-70
-71</pre>
+96
+97
+98</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 69</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 96</span>
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rbracket'>]</span>
@@ -538,7 +637,7 @@
<div class="method_details ">
<h3 class="signature " id="each-class_method">
- .<strong>each</strong> &#x21d2; <tt>Enumerator</tt>
+ .<strong>each</strong>(&amp;block) &#x21d2; <tt>Enumerator</tt>
@@ -547,7 +646,7 @@
</h3><div class="docstring">
<div class="discussion">
-<p>Iterates over all components within the component manager</p>
+<p>Iterates over all components within the component manager. Special Enumerable methods like <code>map</code> or <code>each_with_index</code> are not implemented</p>
</div>
@@ -574,114 +673,15 @@
<pre class="lines">
-95
-96
-97
-98
-99</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 95</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
- <span class='id identifier rubyid_data'>data</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_component'>component</span><span class='op'>|</span>
- <span class='kw'>yield</span> <span class='id identifier rubyid_component'>component</span>
- <span class='kw'>end</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- <div class="method_details ">
- <h3 class="signature " id="new-class_method">
-
- .<strong>new</strong>(**attrs) &#x21d2; <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>
-
-
-
- </li>
-
-</ul>
-
-<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">
-
-
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91</pre>
+103
+104
+105</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 76</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_new_component'>new_component</span> <span class='op'>=</span> <span class='kw'>super</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 103</span>
- <span class='comment'># Generate ID
-</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
- <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_id'>new_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
- <span class='id identifier rubyid_new_component'>new_component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</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_new_component'>new_component</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</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='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_new_id'>new_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_component'>new_component</span>
+<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</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_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
@@ -738,14 +738,14 @@
<pre class="lines">
-137
-138
-139
-140
-141</pre>
+143
+144
+145
+146
+147</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 137</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 143</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</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>
@@ -801,20 +801,20 @@
<pre class="lines">
-124
-125
-126
-127
-128
-129
130
131
132
133
-134</pre>
+134
+135
+136
+137
+138
+139
+140</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 124</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 130</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_entities'>entities</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_entity_id'>entity_id</span><span class='op'>|</span>
@@ -835,7 +835,7 @@
<div class="method_details ">
<h3 class="signature " id="entities-instance_method">
- #<strong>entities</strong> &#x21d2; <tt>Array</tt>
+ #<strong>entities</strong> &#x21d2; <tt>Array&lt;Integer&gt;</tt>
@@ -844,7 +844,7 @@
</h3><div class="docstring">
<div class="discussion">
-<p>A list of components that are linked to the component</p>
+<p>A list of entity ids that are linked to the component</p>
</div>
@@ -857,7 +857,7 @@
<li>
- <span class='type'>(<tt>Array</tt>)</span>
+ <span class='type'>(<tt>Array&lt;Integer&gt;</tt>)</span>
@@ -871,12 +871,12 @@
<pre class="lines">
-110
-111
-112</pre>
+116
+117
+118</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 110</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 116</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>
@@ -925,12 +925,12 @@
<pre class="lines">
-104
-105
-106</pre>
+110
+111
+112</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 104</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 110</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
<span class='id identifier rubyid_id'>id</span>
@@ -984,12 +984,12 @@
<pre class="lines">
-146
-147
-148</pre>
+152
+153
+154</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 146</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 152</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span>
<span class='comment'># should return a json or hash of all data in this component
@@ -1043,14 +1043,14 @@
<pre class="lines">
-116
-117
-118
-119
-120</pre>
+122
+123
+124
+125
+126</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 116</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 122</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>
@@ -1067,7 +1067,7 @@
</div>
<div id="footer">
- Generated on Fri Jun 11 01:49:32 2021 by
+ Generated on Sat Jun 12 00:56:07 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>