Class: RbEAI::LogicFilter

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

Instance Method Summary collapse

Constructor Details

#initialize(xmlDoc) ⇒ LogicFilter

Returns a new instance of LogicFilter.



45
46
47
48
49
50
# File 'lib/rbeai/RouterLogic.rb', line 45

def initialize(xmlDoc)
  @parsers = []
  XPath.each(xmlDoc, "./when") do |el|
    @parsers << _getParser(el)     
  end
end

Instance Method Details

#match(file) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/rbeai/RouterLogic.rb', line 52

def match(file)
  result = true
  @parsers.each do | parser |
    begin
      if parser.match(file)
        result = true
        break
      else
        result = false
      end
    rescue Exception
      result = false
    end
  end    
  return result
end