class MWDictionaryAPI::MemoryCache

Public Class Methods

add(term, result) click to toggle source
# File lib/mw_dictionary_api/memory_cache.rb, line 11
def self.add(term, result)
  cache[term] = result
end
cache() click to toggle source
# File lib/mw_dictionary_api/memory_cache.rb, line 24
def self.cache
  @cache ||= {}
end
clear() click to toggle source

following methods are optional

# File lib/mw_dictionary_api/memory_cache.rb, line 20
def self.clear
  cache.clear
end
find(term) click to toggle source
# File lib/mw_dictionary_api/memory_cache.rb, line 7
def self.find(term)
  cache[term]
end
remove(term) click to toggle source
# File lib/mw_dictionary_api/memory_cache.rb, line 15
def self.remove(term)
  cache.delete(term)
end