Class: ActionController::Caching::Actions::ActionCachePath
- Inherits:
-
Object
- Object
- ActionController::Caching::Actions::ActionCachePath
- Defined in:
- actionpack/lib/action_controller/caching/actions.rb
Instance Attribute Summary (collapse)
-
- (Object) extension
readonly
Returns the value of attribute extension.
-
- (Object) path
readonly
Returns the value of attribute path.
Instance Method Summary (collapse)
-
- (ActionCachePath) initialize(controller, options = {}, infer_extension = true)
constructor
If infer_extension is true, the cache path extension is looked up from the request's path and format.
Constructor Details
- (ActionCachePath) initialize(controller, options = {}, infer_extension = true)
If infer_extension is true, the cache path extension is looked up from the request's path and format. This is desirable when reading and writing the cache, but not when expiring the cache - expire_action should expire the same files regardless of the request format.
164 165 166 167 168 169 170 171 172 |
# File 'actionpack/lib/action_controller/caching/actions.rb', line 164 def initialize(controller, = {}, infer_extension = true) if infer_extension @extension = controller.params[:format] .reverse_merge!(:format => @extension) if .is_a?(Hash) end path = controller.url_for().split(%r{://}).last @path = normalize!(path) end |
Instance Attribute Details
- (Object) extension (readonly)
Returns the value of attribute extension
158 159 160 |
# File 'actionpack/lib/action_controller/caching/actions.rb', line 158 def extension @extension end |
- (Object) path (readonly)
Returns the value of attribute path
158 159 160 |
# File 'actionpack/lib/action_controller/caching/actions.rb', line 158 def path @path end |