Class: RbEAI::LogicFilter
- Inherits:
-
Object
- Object
- RbEAI::LogicFilter
- Defined in:
- lib/rbeai/RouterLogic.rb
Instance Method Summary collapse
-
#initialize(xmlDoc) ⇒ LogicFilter
constructor
A new instance of LogicFilter.
- #match(file) ⇒ Object
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 |