Class: ActionController::Caching::Actions::ActionCachePath

Inherits:
Object
  • Object
show all
Defined in:
lib/action_controller/caching.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, options = {}) ⇒ ActionCachePath

Returns a new instance of ActionCachePath.



275
276
277
278
279
280
281
# File 'lib/action_controller/caching.rb', line 275

def initialize(controller, options = {})
  @extension = extract_extension(controller.request.path)
  path = controller.url_for(options).split('://').last
  normalize!(path)
  add_extension!(path, @extension)
  @path = URI.unescape(path)
end

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



267
268
269
# File 'lib/action_controller/caching.rb', line 267

def extension
  @extension
end

#pathObject (readonly)

Returns the value of attribute path.



267
268
269
# File 'lib/action_controller/caching.rb', line 267

def path
  @path
end

Class Method Details

.path_for(controller, options) ⇒ Object



270
271
272
# File 'lib/action_controller/caching.rb', line 270

def path_for(controller, options)
  new(controller, options).path
end