Sha256: b45895bc51068225550489dcf2355262f7006a0be8314d8e38c0299918150c3a

Contents?: true

Size: 408 Bytes

Versions: 6

Compression:

Stored size: 408 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.dup, _options)
      else
        @block.call(text.dup)
      end
    end
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
dejan-auto_html-1.1.0 lib/auto_html/filter.rb
dejan-auto_html-1.1.1 lib/auto_html/filter.rb
dejan-auto_html-1.1.2 lib/auto_html/filter.rb
dejan-auto_html-1.2.0 lib/auto_html/filter.rb
auto_html-1.2.1 lib/auto_html/filter.rb
auto_html-1.2.0 lib/auto_html/filter.rb