Class: Hyalite::Component::ChildrenRenderer
- Defined in:
- lib/hyalite/component.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
-
#initialize(component, hook_setter) ⇒ ChildrenRenderer
constructor
A new instance of ChildrenRenderer.
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(component, hook_setter) ⇒ ChildrenRenderer
Returns a new instance of ChildrenRenderer.
104 105 106 107 108 109 110 |
# File 'lib/hyalite/component.rb', line 104 def initialize(component, hook_setter) @component = component @children = [] hook_setter.hook do |el| @children << el end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
118 119 120 121 122 123 124 |
# File 'lib/hyalite/component.rb', line 118 def method_missing(method_name, *args, &block) if @component.respond_to?(method_name, true) @component.send(method_name, *args, &block) else super end end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
102 103 104 |
# File 'lib/hyalite/component.rb', line 102 def children @children end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
126 127 128 |
# File 'lib/hyalite/component.rb', line 126 def respond_to_missing?(method_name, include_private = false) @component.respond_to?(method_name, include_private) || super end |