Module: Cacheble

Defined in:
lib/a-commons.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_cacheObject



818
819
820
# File 'lib/a-commons.rb', line 818

def self.clear_cache
  @@cache.clear
end

.extended(_obj) ⇒ Object



806
807
808
# File 'lib/a-commons.rb', line 806

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

.get_cache(_key, _value) ⇒ Object



826
827
828
# File 'lib/a-commons.rb', line 826

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

.included(_obj) ⇒ Object



810
811
812
# File 'lib/a-commons.rb', line 810

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

.set_cache(_key, _value) ⇒ Object



822
823
824
# File 'lib/a-commons.rb', line 822

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

Instance Method Details

#__initialize_cache(_obj) ⇒ Object



814
815
816
# File 'lib/a-commons.rb', line 814

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