Class: RbEAI::SazParser
- Inherits:
-
Object
- Object
- RbEAI::SazParser
- Defined in:
- lib/rbeai/RouterLogic.rb
Instance Method Summary collapse
-
#initialize(node, expression) ⇒ SazParser
constructor
A new instance of SazParser.
- #match(file) ⇒ Object
Constructor Details
#initialize(node, expression) ⇒ SazParser
Returns a new instance of SazParser.
137 138 139 140 |
# File 'lib/rbeai/RouterLogic.rb', line 137 def initialize(node, expression) @resultList = node.elements["."].text @node = expression end |
Instance Method Details
#match(file) ⇒ Object
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/rbeai/RouterLogic.rb', line 142 def match(file) result = "nil" f = File.new(file) parser = Parsers::SAX2Parser.new( f ) parser.listen( :characters , @node) do |text| result = text if @resultList.include?(text) end parser.parse return @resultList.include?(result) end |