Module: Mullet::Container
- Included in:
- HTML::ElementRenderer, HTML::Template
- Defined in:
- lib/mullet/container.rb
Overview
Collection of renderers which will be rendered in the order they were added.
Instance Method Summary collapse
- #add_child(child) ⇒ Object
- #children ⇒ Object
- #clear_children ⇒ Object
- #delete_child(child) ⇒ Object
- #initialize ⇒ Object
-
#render_children(render_context) ⇒ Object
Renders children in order they were added.
Instance Method Details
#add_child(child) ⇒ Object
10 11 12 |
# File 'lib/mullet/container.rb', line 10 def add_child(child) @children.push(child) end |
#children ⇒ Object
18 19 20 |
# File 'lib/mullet/container.rb', line 18 def children() return @children end |
#clear_children ⇒ Object
22 23 24 |
# File 'lib/mullet/container.rb', line 22 def clear_children() @children.clear() end |
#delete_child(child) ⇒ Object
14 15 16 |
# File 'lib/mullet/container.rb', line 14 def delete_child(child) @children.delete(child); end |
#initialize ⇒ Object
5 6 7 8 |
# File 'lib/mullet/container.rb', line 5 def initialize() super if defined?(super) @children = [] end |
#render_children(render_context) ⇒ Object
Renders children in order they were added.
30 31 32 33 34 |
# File 'lib/mullet/container.rb', line 30 def render_children(render_context) @children.each do |child| child.render(render_context) end end |