Class: TRuby::TypeResolutionCache

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

Overview

Type resolution cache

Instance Method Summary collapse

Constructor Details

#initializeTypeResolutionCache

Returns a new instance of TypeResolutionCache.



240
241
242
# File 'lib/t_ruby/cache.rb', line 240

def initialize
  @cache = MemoryCache.new(max_size: 2000)
end

Instance Method Details

#clearObject



252
253
254
# File 'lib/t_ruby/cache.rb', line 252

def clear
  @cache.clear
end

#get(type_expression) ⇒ Object



244
245
246
# File 'lib/t_ruby/cache.rb', line 244

def get(type_expression)
  @cache.get(type_expression)
end

#set(type_expression, resolved_type) ⇒ Object



248
249
250
# File 'lib/t_ruby/cache.rb', line 248

def set(type_expression, resolved_type)
  @cache.set(type_expression, resolved_type)
end

#statsObject



256
257
258
# File 'lib/t_ruby/cache.rb', line 256

def stats
  @cache.stats
end