Class: Alula::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/core_ext/filter.rb

Direct Known Subclasses

Smilies

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Filter

Returns a new instance of Filter.



14
15
16
# File 'lib/alula/core_ext/filter.rb', line 14

def initialize(options)
  @options = options
end

Class Method Details

.filtersObject



4
# File 'lib/alula/core_ext/filter.rb', line 4

def self.filters; @@filters ||= {}; end

.load(name, options) ⇒ Object



7
8
9
10
11
12
# File 'lib/alula/core_ext/filter.rb', line 7

def self.load(name, options)
  if filters[name]
    filter = filters[name].new(options)
    return filter
  end
end

.register(name, klass) ⇒ Object



3
# File 'lib/alula/core_ext/filter.rb', line 3

def self.register(name, klass); filters[name.to_s] = klass; end

Instance Method Details

#filtersObject



5
# File 'lib/alula/core_ext/filter.rb', line 5

def filters; self.class.filters; end