class Apollo::Cache::BaseCache

Public Class Methods

new(options = {}) click to toggle source
# File lib/apollo_crawler/cache/base_cache.rb, line 24
def initialize(options = {})
end

Public Instance Methods

remove(key) click to toggle source
# File lib/apollo_crawler/cache/base_cache.rb, line 44
def remove(key)
        # self.set(key, nil)
end
set(key, value) click to toggle source

Set value associated with key Return cached value

# File lib/apollo_crawler/cache/base_cache.rb, line 40
def set(key, value)
        return value
end
try_get(key, *args) { |args| ... } click to toggle source

Get value associated with key from cache

# File lib/apollo_crawler/cache/base_cache.rb, line 28
def try_get(key, *args)

        # Not found, Create, cache and return
        if block_given?
                res = yield args
        end
        
        return res
end