Method: Ox::Element#each
- Defined in:
- lib/ox/element.rb
#each(cond = nil, &block) ⇒ Object
Iterate over each child of the instance yielding according to the cond argument value. If the cond argument is nil then all child nodes are yielded to. If cond is a string then only the child Elements with a matching name will be yielded to. If the cond is a Hash then the keys-value pairs in the cond must match the child attribute values with the same keys. Any other cond type will yield to nothing.
124 125 126 |
# File 'lib/ox/element.rb', line 124 def each(cond=nil, &block) build_enumerator(cond).each(&block) end |