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-0.5.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.5.0 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.4.2 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.4.1 lib/reveal-ck/filtered_html_string.rb
reveal-ck-0.4.0 lib/reveal-ck/filtered_html_string.rb