Module: Cacheble

Defined in:
lib/a-commons.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_cacheObject



885
886
887
# File 'lib/a-commons.rb', line 885

def self.clear_cache
  @@cache.clear
end

.extended(_obj) ⇒ Object



873
874
875
# File 'lib/a-commons.rb', line 873

def self.extended(_obj)
  _obj.__initialize_cache(_obj)
end

.get_cache(_key, _value) ⇒ Object



893
894
895
# File 'lib/a-commons.rb', line 893

def self.get_cache(_key, _value)
  @@cache[_key]
end

.included(_obj) ⇒ Object



877
878
879
# File 'lib/a-commons.rb', line 877

def self.included(_obj)
  _obj.__initialize_cache(_obj)
end

.set_cache(_key, _value) ⇒ Object



889
890
891
# File 'lib/a-commons.rb', line 889

def self.set_cache(_key, _value)
  @@cache[_key]=_value
end

Instance Method Details

#__initialize_cache(_obj) ⇒ Object



881
882
883
# File 'lib/a-commons.rb', line 881

def __initialize_cache(_obj)
  @@cache = Hash.new
end