Class: Solargraph::LiveMap::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/solargraph/live_map/cache.rb

Instance Method Summary collapse

Constructor Details

#initializeCache

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

#clearObject



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 options
  @method_cache[options]
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 options, values
  @method_cache[options] = values
end