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

Inherits:
Object
  • Object
show all
Defined in:
lib/action_controller/caching/actions.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.



119
120
121
122
123
124
125
# File 'lib/action_controller/caching/actions.rb', line 119

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.



111
112
113
# File 'lib/action_controller/caching/actions.rb', line 111

def extension
  @extension
end

#pathObject (readonly)

Returns the value of attribute path.



111
112
113
# File 'lib/action_controller/caching/actions.rb', line 111

def path
  @path
end

Class Method Details

.path_for(controller, options) ⇒ Object



114
115
116
# File 'lib/action_controller/caching/actions.rb', line 114

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