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, &block) ⇒ Object (private)



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

def method_missing(method, *arguments, &block)
  return if @controller.nil?
  @controller.__send__(method, *arguments, &block)
end

Instance Attribute Details

#controllerObject

Returns the value of attribute controller.



55
56
57
# File 'lib/action_controller/caching/sweeping.rb', line 55

def controller
  @controller
end

Instance Method Details

#after(controller) ⇒ Object



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

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



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

def before(controller)
  self.controller = controller
  callback(:before) if controller.perform_caching
  true # before method from sweeper should always return true
end