Class: TextFilter

Inherits:
Object
  • Object
show all
Includes:
Annotatable, Simpleton
Defined in:
app/models/text_filter.rb

Direct Known Subclasses

HamlFilter

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Annotatable

included

Methods included from Simpleton

included

Class Method Details

.descendants_namesObject



20
21
22
# File 'app/models/text_filter.rb', line 20

def descendants_names
  descendants.map { |s| s.filter_name }.sort
end

.filter(text) ⇒ Object



16
17
18
# File 'app/models/text_filter.rb', line 16

def filter(text)
  instance.filter(text)
end

.find_descendant(filter_name) ⇒ Object



24
25
26
27
28
29
# File 'app/models/text_filter.rb', line 24

def find_descendant(filter_name)
  descendants.each do |s|
    return s if s.filter_name == filter_name
  end
  nil
end

.inherited(subclass) ⇒ Object



12
13
14
# File 'app/models/text_filter.rb', line 12

def inherited(subclass)
  subclass.filter_name = subclass.name.to_name('Filter')
end

Instance Method Details

#filter(text) ⇒ Object



7
8
9
# File 'app/models/text_filter.rb', line 7

def filter(text)
  text
end