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.



238
239
240
241
242
243
244
# File 'lib/action_controller/caching.rb', line 238

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.



230
231
232
# File 'lib/action_controller/caching.rb', line 230

def extension
  @extension
end

#pathObject (readonly)

Returns the value of attribute path.



230
231
232
# File 'lib/action_controller/caching.rb', line 230

def path
  @path
end

Class Method Details

.path_for(controller, options) ⇒ Object



233
234
235
# File 'lib/action_controller/caching.rb', line 233

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