Class: RailsAppcache::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_appcache/config.rb

Instance Method Summary collapse

Instance Method Details

#perform_caching=(val) ⇒ Object

Turn caching on or off



16
17
18
# File 'lib/rails_appcache/config.rb', line 16

def perform_caching=(val)
  @perform_caching = !!val
end

#perform_caching?Boolean

Check whether appcache caching is enabled; default off in development, on elsewhere

Returns:

  • (Boolean)


11
12
13
# File 'lib/rails_appcache/config.rb', line 11

def perform_caching?
  @perform_caching || !Rails.env.development?
end

#versionObject

Return the current manifests version string, falling back to the Rails asset version string



21
22
23
# File 'lib/rails_appcache/config.rb', line 21

def version
  @appcache_version || Rails.application.config.assets.version
end

#version=(value) ⇒ Object

Assign an explicit version to our manifests



26
27
28
# File 'lib/rails_appcache/config.rb', line 26

def version=(value)
  @appcache_version = value
end