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
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
#clear ⇒ Object
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 |
#stats ⇒ Object
255 256 257 |
# File 'lib/t_ruby/cache.rb', line 255 def stats @cache.stats end |