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.



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

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

Instance Method Details

#clearObject



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

def clear
  @cache.clear
end

#get(type_expression) ⇒ Object



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

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

#set(type_expression, resolved_type) ⇒ Object



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

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

#statsObject



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

def stats
  @cache.stats
end