Sha256: 6e6cfde6e660c3558bd956b3c715190922be8a456a19e182ee491ff444bb8152

Contents?: true

Size: 416 Bytes

Versions: 21

Compression:

Stored size: 416 Bytes

Contents

module AutoHtml
  class Filter
    def initialize(block)
      @block = block
      @options = nil
    end

    def with(options, &block)
      @options = options
      @block = block
    end

    def apply(text, options = {})
      _options = @options && @options.merge(options)
      if _options
        @block.call(text.to_s.dup, _options)
      else
        @block.call(text.to_s.dup)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
auto_html-whistlerbrk-2.0.0.pre lib/auto_html/filter.rb
auto_html-1.6.4 lib/auto_html/filter.rb
auto_html-1.6.3 lib/auto_html/filter.rb
auto_html-1.5.1.1 lib/auto_html/filter.rb
auto_html-1.6.2 lib/auto_html/filter.rb
auto_html-1.6.1 lib/auto_html/filter.rb
auto_html-1.6.0 lib/auto_html/filter.rb
auto_html-1.5.3 lib/auto_html/filter.rb
auto_html-1.5.2 lib/auto_html/filter.rb
auto_html-1.5.1 lib/auto_html/filter.rb
auto_html-1.5.0 lib/auto_html/filter.rb
marcosinger-auto_html-1.3.6 lib/auto_html/filter.rb
auto_html-1.4.2 lib/auto_html/filter.rb
auto_html-1.4.1 lib/auto_html/filter.rb
auto_html-1.4.0 lib/auto_html/filter.rb
auto_html-1.3.7 lib/auto_html/filter.rb
marcosinger-auto_html-1.3.5 lib/auto_html/filter.rb
marcosinger-auto_html-1.3.4 lib/auto_html/filter.rb
auto_html-1.3.6 lib/auto_html/filter.rb
auto_html-1.3.5 lib/auto_html/filter.rb