Engine
REXML Adaptor
# File lib/jam/rexml.rb, line 76 def append(ns, child) if Array === child case ns when ::REXML::Element ns.add_element(child) when Array ns.each do |n| nadd_element(child) end end else case ns when ::REXML::Element ns.add_element(child) when Array ns.each do |n| n.add_element(child) end end end end
# File lib/jam/rexml.rb, line 110 def attribute(ns, att, val) case ns when ::REXML::Element ns.attr(att, val) when Array ns.each do |n| ns.attr(att, val) end end end
deep copy
# File lib/jam/rexml.rb, line 54 def copy(node) node.copy(true) end
# File lib/jam/rexml.rb, line 43 def document(source) ::REXML::Document.new(source, *@options) end
Iterate over each node.
# File lib/jam/rexml.rb, line 123 def each_node(nodes) unless Array === nodes nodes = [nodes] end nodes.each do |node| yield(node) end end
# File lib/jam/rexml.rb, line 64 def empty(ns) case ns when ::REXML::Element ns.inner_html = '' when Array ns.each do |n| n.inner_html = '' end end end
# File lib/jam/rexml.rb, line 105 def remove(node) node.remove end
# File lib/jam/rexml.rb, line 59 def remove(node) node.remove end
Disabled; run with --debug to generate this.