Object
This class parses introspection XML of an object and constructs a tree of Node, Interface, Method, Signal instances.
return a pair: [list of Interfaces, list of direct subnode names]
# File lib/dbus/introspect.rb, line 243 def parse interfaces = Array.new subnodes = Array.new t = Time.now d = REXML::Document.new(@xml) d.elements.each("node/node") do |e| subnodes << e.attributes["name"] end d.elements.each("node/interface") do |e| i = Interface.new(e.attributes["name"]) e.elements.each("method") do |me| m = Method.new(me.attributes["name"]) parse_methsig(me, m) i << m end e.elements.each("signal") do |se| s = Signal.new(se.attributes["name"]) parse_methsig(se, s) i << s end interfaces << i end d = Time.now - t if d > 2 puts "Some XML took more that two secs to parse. Optimize me!" if $DEBUG end [interfaces, subnodes] end
Generated with the Darkfish Rdoc Generator 2.