Class: SimpleXurrency
- Inherits:
-
Object
- Object
- SimpleXurrency
- Defined in:
- lib/simple_xurrency.rb
Class Attribute Summary collapse
-
.key ⇒ Object
Returns the value of attribute key.
Class Method Summary collapse
- .cache_add(key, value) ⇒ Object
- .cache_enabled? ⇒ Boolean
- .cache_flush ⇒ Object
- .cache_get(key) ⇒ Object
- .disable_cache ⇒ Object
- .enable_cache ⇒ Object
Class Attribute Details
.key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/simple_xurrency.rb', line 6 def key @key end |
Class Method Details
.cache_add(key, value) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/simple_xurrency.rb', line 34 def cache_add(key, value) if !@cache.is_a?(Hash) @cache = Hash.new end @cache[key] = value end |
.cache_enabled? ⇒ Boolean
8 9 10 11 12 13 14 |
# File 'lib/simple_xurrency.rb', line 8 def cache_enabled? if @cache_enabled.nil? @cache_enabled = true end @cache_enabled end |
.cache_flush ⇒ Object
42 43 44 |
# File 'lib/simple_xurrency.rb', line 42 def cache_flush @cache = Hash.new end |
.cache_get(key) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/simple_xurrency.rb', line 24 def cache_get(key) ret = nil if @cache.is_a?(Hash) ret = @cache[key] end ret end |
.disable_cache ⇒ Object
20 21 22 |
# File 'lib/simple_xurrency.rb', line 20 def disable_cache @cache_enabled = false end |
.enable_cache ⇒ Object
16 17 18 |
# File 'lib/simple_xurrency.rb', line 16 def enable_cache @cache_enabled = true end |