Class: ActionController::Caching::Sweeper

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *arguments) ⇒ Object (private)



90
91
92
93
# File 'lib/action_controller/caching/sweeping.rb', line 90

def method_missing(method, *arguments)
  return if @controller.nil?
  @controller.send!(method, *arguments)
end

Instance Attribute Details

#controllerObject

Returns the value of attribute controller.



57
58
59
# File 'lib/action_controller/caching/sweeping.rb', line 57

def controller
  @controller
end

Instance Method Details

#after(controller) ⇒ Object



64
65
66
67
68
# File 'lib/action_controller/caching/sweeping.rb', line 64

def after(controller)
  callback(:after) if controller.perform_caching
  # Clean up, so that the controller can be collected after this request
  self.controller = nil
end

#before(controller) ⇒ Object



59
60
61
62
# File 'lib/action_controller/caching/sweeping.rb', line 59

def before(controller)
  self.controller = controller
  callback(:before) if controller.perform_caching
end