Class: AbstractBuilder::NullCache

Inherits:
Object
  • Object
show all
Defined in:
lib/abstract_builder/null_cache.rb

Instance Method Summary collapse

Instance Method Details

#fetch(key, _options = nil, &block) ⇒ Object



3
4
5
# File 'lib/abstract_builder/null_cache.rb', line 3

def fetch(key, _options = nil, &block)
  block.call
end

#fetch_multi(*keys, options, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/abstract_builder/null_cache.rb', line 7

def fetch_multi(*keys, options, &block)
  result = {}

  keys.each do |key|
    result[key] = fetch(key, options) do
      block.call(key)
    end
  end

  result
end