class T2Server::XML::XPathCache

Public Class Methods

new() click to toggle source
   # File lib/t2-server/xml/xpath_cache.rb
41 def initialize
42   @cache = {}
43   @xpaths = {}
44 end

Public Instance Methods

[](key) click to toggle source
   # File lib/t2-server/xml/xpath_cache.rb
46 def [](key)
47   return nil unless @xpaths.has_key? key
48   return @cache[key] if @cache.has_key? key
49 
50   xpath = @xpaths[key]
51   @cache[key] = xpath_compile(xpath)
52 end
register_xpaths(xpaths) click to toggle source
   # File lib/t2-server/xml/xpath_cache.rb
54 def register_xpaths(xpaths)
55   @xpaths.merge! xpaths
56 end