Sha256: c5891eb487ec535c070ddc39fde9699b98afa6f9ffb0eab590a8591c019fba68

Contents?: true

Size: 537 Bytes

Versions: 25

Compression:

Stored size: 537 Bytes

Contents

module RevealCK
  # Enables easy filtering of an HTML string through an html-pipeline.
  class FilteredHtmlString
    include Retrieve
    attr_reader :html, :pipeline, :config

    def initialize(args)
      @html = retrieve(:html, args)
      @pipeline = retrieve(:pipeline, args)
      @config = retrieve(:config, args)
    end

    def render
      apply_pipeline(pipeline, config).to_s
    end

    private

    def apply_pipeline(pipeline, config)
      result = pipeline.call(html, config)
      result[:output]
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
reveal-ck-4.0.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.9.2 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.9.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.9.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.8.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.8.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.7.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.6.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.5.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.5.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.4.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.3.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.3.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.2.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.1.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.0.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-3.0.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.6.2 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.6.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.6.0 lib/reveal-ck/filtered_html_string.rb