Class: Ruty::FilterCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/ruty/filters.rb

Overview

default class for all filter collections

Direct Known Subclasses

StandardFilters

Class Method Summary collapse

Class Method Details

.each_filter(&block) ⇒ Object

iterate over all filters, used by Filters to register them.


18
19
20
21
22
23
24
25
# File 'lib/ruty/filters.rb', line 18

def self.each_filter &block
  instance = self.new
  instance_methods(false).each do |method_name|
    name = method_name.to_sym
    filter = instance.method(name).to_proc
    block.call(name, filter)
  end
end