Module: Cacheble
- Defined in:
- lib/a-commons.rb
Class Method Summary collapse
- .clear_cache ⇒ Object
- .extended(_obj) ⇒ Object
- .get_cache(_key, _value) ⇒ Object
- .included(_obj) ⇒ Object
- .set_cache(_key, _value) ⇒ Object
Instance Method Summary collapse
Class Method Details
.clear_cache ⇒ Object
797 798 799 |
# File 'lib/a-commons.rb', line 797 def self.clear_cache @@cache.clear end |
.extended(_obj) ⇒ Object
785 786 787 |
# File 'lib/a-commons.rb', line 785 def self.extended(_obj) _obj.__initialize_cache(_obj) end |
.get_cache(_key, _value) ⇒ Object
805 806 807 |
# File 'lib/a-commons.rb', line 805 def self.get_cache(_key, _value) @@cache[_key] end |
.included(_obj) ⇒ Object
789 790 791 |
# File 'lib/a-commons.rb', line 789 def self.included(_obj) _obj.__initialize_cache(_obj) end |
.set_cache(_key, _value) ⇒ Object
801 802 803 |
# File 'lib/a-commons.rb', line 801 def self.set_cache(_key, _value) @@cache[_key]=_value end |
Instance Method Details
#__initialize_cache(_obj) ⇒ Object
793 794 795 |
# File 'lib/a-commons.rb', line 793 def __initialize_cache(_obj) @@cache = Hash.new end |