Class: ActionController::Caching::Actions::ActionCachePath
- Inherits:
-
Object
- Object
- ActionController::Caching::Actions::ActionCachePath
- Defined in:
- lib/patch_utils/actions.rb
Instance Attribute Summary collapse
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(controller, options = {}, infer_extension = true) ⇒ ActionCachePath
constructor
If
infer_extensionis true, the cache path extension is looked up from the request’s path and format.
Constructor Details
#initialize(controller, options = {}, infer_extension = true) ⇒ ActionCachePath
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.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/patch_utils/actions.rb', line 35 def initialize(controller, = {}, infer_extension = true) with_params = .extract!(:with_params) 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) @path = append_query_string!(@path, controller, with_params[:with_params]) if with_params.present? end |
Instance Attribute Details
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
29 30 31 |
# File 'lib/patch_utils/actions.rb', line 29 def extension @extension end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
29 30 31 |
# File 'lib/patch_utils/actions.rb', line 29 def path @path end |