Method: MaRuKu::MDElement#each_element

Defined in:
lib/maruku/structures_iterators.rb

#each_element(e_node_type = nil, &block) ⇒ Object

Yields to each element of specified node_type All elements if e_node_type is nil.



28
29
30
31
32
33
34
35
36
37
# File 'lib/maruku/structures_iterators.rb', line 28

def each_element(e_node_type=nil, &block) 
	@children.each do |c| 
		if c.kind_of? MDElement
			if (not e_node_type) || (e_node_type == c.node_type)
				block.call c
			end
			c.each_element(e_node_type, &block)
		end
	end
end