Module: Cacheble

Defined in:
lib/a-commons.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_cacheObject



526
527
528
# File 'lib/a-commons.rb', line 526

def self.clear_cache
  @@cache.clear
end

.extended(_obj) ⇒ Object



514
515
516
# File 'lib/a-commons.rb', line 514

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

.get_cache(_key, _value) ⇒ Object



534
535
536
# File 'lib/a-commons.rb', line 534

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

.included(_obj) ⇒ Object



518
519
520
# File 'lib/a-commons.rb', line 518

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

.set_cache(_key, _value) ⇒ Object



530
531
532
# File 'lib/a-commons.rb', line 530

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

Instance Method Details

#__initialize_cache(_obj) ⇒ Object



522
523
524
# File 'lib/a-commons.rb', line 522

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