class HTML::Pipeline::BodyContent
Public: Runs a String of content through an HTML
processing pipeline, providing easy access to a generated DocumentFragment.
Attributes
result[R]
Public Class Methods
new(body, context, pipeline)
click to toggle source
Public: Initialize a BodyContent
.
body - A String body. context - A Hash of context options for the filters. pipeline - A HTML::Pipeline
object with one or more Filters.
# File lib/html/pipeline/body_content.rb, line 13 def initialize(body, context, pipeline) @body = body @context = context @pipeline = pipeline end
Public Instance Methods
document()
click to toggle source
Public: Parses the output into a DocumentFragment.
Returns a DocumentFragment.
# File lib/html/pipeline/body_content.rb, line 37 def document @document ||= HTML::Pipeline.parse output end
output()
click to toggle source
Public: Gets the updated body from the Pipeline
result.
Returns a String or DocumentFragment.
# File lib/html/pipeline/body_content.rb, line 30 def output @output ||= result[:output] end