Sha256: 69e0e2b34a5fce0787f453b71561ca86059c05430a84b229325d91c9a6723568
Contents?: true
Size: 544 Bytes
Versions: 138
Compression:
Stored size: 544 Bytes
Contents
class TextFilter include Simpleton include Annotatable annotate :filter_name, :description def filter(text) text end class << self def inherited(subclass) subclass.filter_name = subclass.name.to_name('Filter') end def filter(text) instance.filter(text) end def descendants_names descendants.map { |s| s.filter_name }.sort end def find_descendant(filter_name) descendants.each do |s| return s if s.filter_name == filter_name end nil end end end
Version data entries
138 entries across 138 versions & 1 rubygems