Class: ConfigCat::InMemoryConfigCache

Inherits:
ConfigCache show all
Defined in:
lib/configcat/configcache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInMemoryConfigCache

Returns a new instance of InMemoryConfigCache.



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

def initialize
  @value = {}
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19
20
21
# File 'lib/configcat/configcache.rb', line 19

def value
  @value
end

Instance Method Details

#get(key) ⇒ Object



24
25
26
# File 'lib/configcat/configcache.rb', line 24

def get(key)
  return @value.fetch(key, nil)
end

#set(key, value) ⇒ Object



28
29
30
# File 'lib/configcat/configcache.rb', line 28

def set(key, value)
  @value[key] = value
end