Module: Rack::Filters

Included in:
Action
Defined in:
lib/rack/filters.rb

Instance Method Summary collapse

Instance Method Details

#after_filter(method) ⇒ Object



30
31
32
33
34
# File 'lib/rack/filters.rb', line 30

def after_filter(method)
  unless after_filters.include?(method)
    after_filters << method
  end
end

#after_filtersObject



21
22
23
24
25
26
27
28
# File 'lib/rack/filters.rb', line 21

def after_filters
  @after_filters ||=
    if superclass.respond_to?(:after_filters)
      superclass.after_filters.dup
    else
      []
    end
end

#before_filter(method) ⇒ Object



11
12
13
14
15
# File 'lib/rack/filters.rb', line 11

def before_filter(method)
  unless before_filters.include?(method)
    before_filters << method
  end
end

#before_filtersObject



2
3
4
5
6
7
8
9
# File 'lib/rack/filters.rb', line 2

def before_filters
  @before_filters ||=
    if superclass.respond_to?(:before_filters)
      superclass.before_filters.dup
    else
      []
    end
end

#skip_after_filter(method) ⇒ Object



36
37
38
# File 'lib/rack/filters.rb', line 36

def skip_after_filter(method)
  after_filters.delete(method)
end

#skip_before_filter(method) ⇒ Object



17
18
19
# File 'lib/rack/filters.rb', line 17

def skip_before_filter(method)
  before_filters.delete(method)
end