Module: Nokogiri::CSS::SelectorCache
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | lib/nokogiri/css/selector_cache.rb |
Class Method Summary
-
.[](key)
Retrieve the cached XPath expressions for the key.
-
.[]=(key, value)
Insert the XPath expressions
value
at the cache key. -
.clear_cache(create_new_object = false)
Clear the cache.
-
.key(selector:, visitor:)
Construct a unique key cache key.
Class Method Details
.[](key)
Retrieve the cached XPath expressions for the key
.[]=(key, value)
Insert the XPath expressions value
at the cache key
.clear_cache(create_new_object = false)
Clear the cache
# File 'lib/nokogiri/css/selector_cache.rb', line 21
def clear_cache(create_new_object = false) @mutex.synchronize do if create_new_object # used in tests to avoid 'method redefined' warnings when injecting spies @cache = {} else @cache.clear end end end
.key(selector:, visitor:)
Construct a unique key cache key
# File 'lib/nokogiri/css/selector_cache.rb', line 32
def key(selector:, visitor:) [selector, visitor.config] end