Sha256: 5a1ac4c37a89a0ce429ddf1c11314f62f378550b16a950294ddfb7f07f4ef2cf

Contents?: true

Size: 505 Bytes

Versions: 4

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

module Caramelize
  class FilterProcessor
    attr_reader :filters, :input_wiki

    def initialize(input_wiki)
      @filters = []
      @input_wiki = input_wiki

      initialize_wiki_filters
    end

    def run(body)
      body_new = body
      filters.each do |filter|
        body_new = filter.new(body_new).run
      end
      body_new
    end

    private

    def initialize_wiki_filters
      filters << input_wiki.filters
      filters.flatten!
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
caramelize-1.3.1 lib/caramelize/filter_processor.rb
caramelize-1.3.0 lib/caramelize/filter_processor.rb
caramelize-1.2.1 lib/caramelize/filter_processor.rb
caramelize-1.2.0 lib/caramelize/filter_processor.rb