Class: TRuby::TypeResolutionCache
- Inherits:
-
Object
- Object
- TRuby::TypeResolutionCache
- Defined in:
- lib/t_ruby/cache.rb
Overview
Type resolution cache
Instance Method Summary collapse
- #clear ⇒ Object
- #get(type_expression) ⇒ Object
-
#initialize ⇒ TypeResolutionCache
constructor
A new instance of TypeResolutionCache.
- #set(type_expression, resolved_type) ⇒ Object
- #stats ⇒ Object
Constructor Details
#initialize ⇒ TypeResolutionCache
240 241 242 |
# File 'lib/t_ruby/cache.rb', line 240 def initialize @cache = MemoryCache.new(max_size: 2000) end |
Instance Method Details
#clear ⇒ Object
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 |
#stats ⇒ Object
256 257 258 |
# File 'lib/t_ruby/cache.rb', line 256 def stats @cache.stats end |