Class: Geewiz::VarCache
- Inherits:
-
Object
- Object
- Geewiz::VarCache
- Defined in:
- lib/geewiz/var_cache.rb
Overview
VarCache is responsible for caching variables and interacting with Geewiz to store variables.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(*args) ⇒ Object
-
#initialize(client) ⇒ VarCache
constructor
A new instance of VarCache.
- #store(name, value) ⇒ Object
Constructor Details
#initialize(client) ⇒ VarCache
Returns a new instance of VarCache.
4 5 6 7 |
# File 'lib/geewiz/var_cache.rb', line 4 def initialize(client) @client = client @vars = {} end |
Instance Method Details
#[](name) ⇒ Object
9 10 11 |
# File 'lib/geewiz/var_cache.rb', line 9 def [](name) @vars[name.to_s] end |
#[]=(*args) ⇒ Object
13 14 15 |
# File 'lib/geewiz/var_cache.rb', line 13 def []=(*args) @client.var(*args) end |
#store(name, value) ⇒ Object
17 18 19 |
# File 'lib/geewiz/var_cache.rb', line 17 def store(name, value) @vars[name.to_s] = value end |