class HTMLPipeline::TextFilter

Attributes

text[R]

Public Class Methods

call(text, context: {}, result: {}) click to toggle source
# File lib/html_pipeline/text_filter.rb, line 12
def call(text, context: {}, result: {})
  raise TypeError, "text must be a String" unless text.is_a?(String)

  # Ensure that this is always a string
  text = text.respond_to?(:to_str) ? text.to_str : text.to_s
  new(context: context, result: result).call(text)
end
new(context: {}, result: {}) click to toggle source
Calls superclass method HTMLPipeline::Filter::new
# File lib/html_pipeline/text_filter.rb, line 7
def initialize(context: {}, result: {})
  super
end