Class: RbEAI::XPazParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rbeai/RouterLogic.rb

Instance Method Summary collapse

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