Module: Taipo::Cache Private
- Defined in:
- lib/taipo/cache.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
A cache of TypeElement objects created from parsed type definitions
Constant Summary collapse
- @@Cache =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
The hash that acts as the cache
{}
Class Method Summary collapse
-
.[](k) ⇒ Taipo::TypeElement, NilClass
private
Retrieve the TypeElement object described by the type definition from the cache.
-
.[]=(k, v) ⇒ Taipo::TypeElement
private
Save the TypeElement object described by the type definition in the cache.
-
.reset ⇒ Object
private
Reset the cache.
Class Method Details
.[](k) ⇒ Taipo::TypeElement, NilClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retrieve the TypeElement object described by the type definition from the cache
25 26 27 |
# File 'lib/taipo/cache.rb', line 25 def self.[](k) @@Cache[k] end |
.[]=(k, v) ⇒ Taipo::TypeElement
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Save the TypeElement object described by the type definition in the cache
39 40 41 |
# File 'lib/taipo/cache.rb', line 39 def self.[]=(k,v) @@Cache[k] = v end |
.reset ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Reset the cache
47 48 49 50 |
# File 'lib/taipo/cache.rb', line 47 def self.reset() @@Cache = {} return nil end |