Class: RbEAI::XPazParser
- Inherits:
-
Object
- Object
- RbEAI::XPazParser
- Defined in:
- lib/rbeai/RouterLogic.rb
Instance Method Summary collapse
-
#initialize(node, expression) ⇒ XPazParser
constructor
A new instance of XPazParser.
- #match(file) ⇒ Object
Constructor Details
#initialize(node, expression) ⇒ XPazParser
Returns a new instance of XPazParser.
116 117 118 119 |
# File 'lib/rbeai/RouterLogic.rb', line 116 def initialize(node, expression) @resultList = node.elements["."].text @xpath = expression end |
Instance Method Details
#match(file) ⇒ Object
121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/rbeai/RouterLogic.rb', line 121 def match(file) ario = rio("#{file}") xmlString = ario.contents xmldoc = REXML::Document.new(xmlString) result = false XPath.each(xmldoc, "#{@xpath}") do |el| result = @resultList.include?(el.text) break if result end return result end |