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

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

#childrenObject



18
19
20
# File 'lib/mullet/container.rb', line 18

def children()
  return @children
end

#clear_childrenObject



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

#initializeObject



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.

Parameters:



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