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.



67
68
69
# File 'lib/dbus/xml.rb', line 67

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

Instance Method Details

#each(path, &block) ⇒ Object



71
72
73
# File 'lib/dbus/xml.rb', line 71

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