Sha256: ba229b390aa98f4ac971fef22a8117596127ba23887f127650e28bd26baf6e6a
Contents?: true
Size: 659 Bytes
Versions: 58
Compression:
Stored size: 659 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 description_file(filename) text = File.read(filename) rescue "" self.description 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
58 entries across 58 versions & 1 rubygems