Class: Solargraph::LiveMap::Cache
- Inherits:
-
Object
- Object
- Solargraph::LiveMap::Cache
- Defined in:
- lib/solargraph/live_map/cache.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #get_constants(namespace, root) ⇒ Object
- #get_methods(options) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #set_constants(namespace, root, values) ⇒ Object
- #set_methods(options, values) ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
4 5 6 7 |
# File 'lib/solargraph/live_map/cache.rb', line 4 def initialize @method_cache = {} @constant_cache = {} end |
Instance Method Details
#clear ⇒ Object
25 26 27 28 |
# File 'lib/solargraph/live_map/cache.rb', line 25 def clear @method_cache.clear @constant_cache.clear end |
#get_constants(namespace, root) ⇒ Object
17 18 19 |
# File 'lib/solargraph/live_map/cache.rb', line 17 def get_constants namespace, root @constant_cache[[namespace, root]] end |
#get_methods(options) ⇒ Object
9 10 11 |
# File 'lib/solargraph/live_map/cache.rb', line 9 def get_methods @method_cache[] end |
#set_constants(namespace, root, values) ⇒ Object
21 22 23 |
# File 'lib/solargraph/live_map/cache.rb', line 21 def set_constants namespace, root, values @constant_cache[[namespace, root]] = values end |
#set_methods(options, values) ⇒ Object
13 14 15 |
# File 'lib/solargraph/live_map/cache.rb', line 13 def set_methods , values @method_cache[] = values end |