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.



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

def initialize(controller, options = {})
  @controller = controller
  @options    = options
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



220
221
222
# File 'lib/action_controller/caching.rb', line 220

def controller
  @controller
end

#optionsObject (readonly)

Returns the value of attribute options.



220
221
222
# File 'lib/action_controller/caching.rb', line 220

def options
  @options
end

Class Method Details

.path_for(*args, &block) ⇒ Object



223
224
225
# File 'lib/action_controller/caching.rb', line 223

def path_for(*args, &block)
  new(*args).path
end

Instance Method Details

#extensionObject



241
242
243
# File 'lib/action_controller/caching.rb', line 241

def extension
  @extension ||= extract_extension(controller.request.path)
end

#pathObject



233
234
235
236
237
238
239
# File 'lib/action_controller/caching.rb', line 233

def path
  return @path if @path
  @path = controller.url_for(options).split('://').last
  normalize!
  add_extension!
  URI.unescape(@path)
end