Module: Cacheble

Defined in:
lib/a-commons.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_cacheObject



734
735
736
# File 'lib/a-commons.rb', line 734

def self.clear_cache
  @@cache.clear
end

.extended(_obj) ⇒ Object



722
723
724
# File 'lib/a-commons.rb', line 722

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

.get_cache(_key, _value) ⇒ Object



742
743
744
# File 'lib/a-commons.rb', line 742

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

.included(_obj) ⇒ Object



726
727
728
# File 'lib/a-commons.rb', line 726

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

.set_cache(_key, _value) ⇒ Object



738
739
740
# File 'lib/a-commons.rb', line 738

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

Instance Method Details

#__initialize_cache(_obj) ⇒ Object



730
731
732
# File 'lib/a-commons.rb', line 730

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