From 3a960438c1cfd2211e6cc78095e67c7387e8480b Mon Sep 17 00:00:00 2001 From: realtradam Date: Thu, 10 Jun 2021 12:15:05 -0400 Subject: changed docs location --- docs/FelFlame/Components.html | 378 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 378 insertions(+) create mode 100644 docs/FelFlame/Components.html (limited to 'docs/FelFlame/Components.html') diff --git a/docs/FelFlame/Components.html b/docs/FelFlame/Components.html new file mode 100644 index 0000000..fdb54c0 --- /dev/null +++ b/docs/FelFlame/Components.html @@ -0,0 +1,378 @@ + + + + + + + Class: FelFlame::Components + + — Documentation by YARD 0.9.26 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: FelFlame::Components + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Enumerable
+
+ + + + + + + + +
+
Defined in:
+
felflame.rb,
+ component_manager.rb
+
+
+ +
+ +

Overview

+
+ +

Creates component managers and allows accessing them them under the Components namespace as Constants

+ +

To see how component managers are used please look at the Helper::ComponentManagerTemplate documentation.

+ +

TODO: Improve Component overview

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + + +
+

Class Method Details

+ + +
+

+ + .each(&block) ⇒ Enumerator + + + + + +

+
+ +

Iterate over all existing component managers. You also call other enumerable methods instead of each, such as `each_with_index` or `select`

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Enumerator) + + + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'component_manager.rb', line 32
+
+def each(&block)
+  constants.each(&block)
+end
+
+
+ +
+

+ + .new(component_name, *attrs, **attrs_with_defaults) ⇒ Object + + + + + +

+
+ +

Creates a new component manager.

+ + +
+
+
+

Parameters:

+
    + +
  • + + component_name + + + (String) + + + + — +
    +

    Name of your new component manager. Must be stylized in the format of constants in Ruby

    +
    + +
  • + +
  • + + attrs + + + (:Symbols) + + + + — +
    +

    New components made with this manager will include these symbols as accessors, the values of these accessors will default to nil

    +
    + +
  • + +
  • + + attrs_with_defaults + + + (Keywords) + + + + — +
    +

    New components made with this manager will include these keywords as accessors, their defaults set to the values given to the keywords

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'component_manager.rb', line 15
+
+def new(component_name, *attrs, **attrs_with_defaults)
+  const_set(component_name, Class.new(FelFlame::Helper::ComponentManagerTemplate) {})
+  attrs.each do |attr|
+    FelFlame::Components.const_get(component_name).attr_accessor attr
+  end
+  attrs_with_defaults.each do |attr, _default|
+    FelFlame::Components.const_get(component_name).attr_accessor attr
+  end
+  FelFlame::Components.const_get(component_name).define_method(:initialize) do
+    attrs_with_defaults.each do |attr, default|
+      instance_variable_set("@#{attr}", default)
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file -- cgit v1.2.3