Module: Erector::Caching::ClassMethods

Defined in:
lib/erector/caching.rb

Instance Method Summary collapse

Instance Method Details

#cacheable(*args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/erector/caching.rb', line 8

def cacheable(*args)
  options = args.extract_options!

  @cacheable_opts = {
    static_keys: args,
    dynamic_keys: if options[:needs_keys]
      needed_variables & options[:needs_keys]
    else
      needed_variables
    end,
    skip_digest: options[:skip_digest]
  }
end

#cacheable_optsObject



22
23
24
# File 'lib/erector/caching.rb', line 22

def cacheable_opts
  @cacheable_opts
end