Class: ActionController::Caching::Sweeper

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



39
40
41
42
# File 'lib/action_controller/caching/sweeper.rb', line 39

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.



6
7
8
# File 'lib/action_controller/caching/sweeper.rb', line 6

def controller
  @controller
end

Instance Method Details

#after(controller) ⇒ Object



13
14
15
16
17
# File 'lib/action_controller/caching/sweeper.rb', line 13

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



8
9
10
11
# File 'lib/action_controller/caching/sweeper.rb', line 8

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