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

Version Path
trusty-cms-6.3.1 app/models/text_filter.rb
trusty-cms-7.0.2 app/models/text_filter.rb
trusty-cms-7.0.1 app/models/text_filter.rb
trusty-cms-7.0.0 app/models/text_filter.rb
trusty-cms-6.3 app/models/text_filter.rb
trusty-cms-6.2.1 app/models/text_filter.rb
trusty-cms-6.2.2.1 app/models/text_filter.rb
trusty-cms-6.2.0 app/models/text_filter.rb
trusty-cms-6.1.2 app/models/text_filter.rb
trusty-cms-6.1.1 app/models/text_filter.rb
trusty-cms-6.0.5 app/models/text_filter.rb
trusty-cms-6.0.4 app/models/text_filter.rb
trusty-cms-6.0.3 app/models/text_filter.rb
trusty-cms-6.0.2 app/models/text_filter.rb
trusty-cms-6.0.1 app/models/text_filter.rb
trusty-cms-5.6.1 app/models/text_filter.rb
trusty-cms-6.0.0 app/models/text_filter.rb
trusty-cms-5.6.0 app/models/text_filter.rb
trusty-cms-5.5.9 app/models/text_filter.rb
trusty-cms-5.5.8 app/models/text_filter.rb