Class: DBus::IntrospectXMLParser::NokogiriParser

Inherits:
AbstractXML
  • Object
show all
Defined in:
lib/dbus/xml.rb

Defined Under Namespace

Classes: NokogiriNode

Instance Method Summary collapse

Methods inherited from AbstractXML

have_nokogiri?

Constructor Details

#initialize(xml) ⇒ NokogiriParser

Returns a new instance of NokogiriParser.



73
74
75
76
# File 'lib/dbus/xml.rb', line 73

def initialize(xml)
  super()
  @doc = Nokogiri.XML(xml)
end

Instance Method Details

#each(path, &block) ⇒ Object



78
79
80
# File 'lib/dbus/xml.rb', line 78

def each(path, &block)
  @doc.search("//#{path}").each { |node| block.call NokogiriNode.new(node) }
end