Method: AbstractBuilder#cache!

Defined in:
lib/abstract_builder.rb

#cache!(cache_key, options = {}, &block) ⇒ Object



76
77
78
79
80
81
82
83
84
# File 'lib/abstract_builder.rb', line 76

def cache!(cache_key, options = {}, &block)
  cache_key = _compute_cache_key(cache_key)

  @lazy_cache.add(cache_key, options) do
    builder = _inherit
    block.call(builder)
    builder.data!
  end
end