Class: TextFilter
- Inherits:
-
Object
- Object
- TextFilter
- Includes:
- Annotatable, Simpleton
- Defined in:
- app/models/text_filter.rb
Direct Known Subclasses
Class Method Summary collapse
- .descendants_names ⇒ Object
- .filter(text) ⇒ Object
- .find_descendant(filter_name) ⇒ Object
- .inherited(subclass) ⇒ Object
Instance Method Summary collapse
Methods included from Annotatable
Methods included from Simpleton
Class Method Details
.descendants_names ⇒ Object
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 |