Class: SimpleXurrency

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_xurrency.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.keyObject

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

Returns:

  • (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_flushObject



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_cacheObject



20
21
22
# File 'lib/simple_xurrency.rb', line 20

def disable_cache
  @cache_enabled = false
end

.enable_cacheObject



16
17
18
# File 'lib/simple_xurrency.rb', line 16

def enable_cache
  @cache_enabled = true
end