Class: ActionController::Filters::Filter

Inherits:
ActiveSupport::Callbacks::Callback
  • Object
show all
Defined in:
lib/action_controller/filters.rb

Overview

:nodoc:

Direct Known Subclasses

AfterFilter, AroundFilter, BeforeFilter

Instance Method Summary collapse

Constructor Details

#initialize(kind, method, options = {}) ⇒ Filter

Returns a new instance of Filter.


107
108
109
110
# File 'lib/action_controller/filters.rb', line 107

def initialize(kind, method, options = {})
  super
  update_options! options
end

Instance Method Details

#after?Boolean

Returns:

  • (Boolean)

117
118
119
# File 'lib/action_controller/filters.rb', line 117

def after?
  false
end

#around?Boolean

Returns:

  • (Boolean)

121
122
123
# File 'lib/action_controller/filters.rb', line 121

def around?
  false
end

#before?Boolean

override these to return true in appropriate subclass

Returns:

  • (Boolean)

113
114
115
# File 'lib/action_controller/filters.rb', line 113

def before?
  false
end

#update_options!(other) ⇒ Object

Make sets of strings from :only/:except options


126
127
128
129
130
131
132
133
134
135
# File 'lib/action_controller/filters.rb', line 126

def update_options!(other)
  if other
    convert_only_and_except_options_to_sets_of_strings(other)
    if other[:skip]
      convert_only_and_except_options_to_sets_of_strings(other[:skip])
    end
  end

  options.update(other)
end