Module: Html2rss::AttributePostProcessors

Defined in:
lib/html2rss/attribute_post_processors.rb,
lib/html2rss/attribute_post_processors/base.rb,
lib/html2rss/attribute_post_processors/gsub.rb,
lib/html2rss/attribute_post_processors/template.rb,
lib/html2rss/attribute_post_processors/parse_uri.rb,
lib/html2rss/attribute_post_processors/substring.rb,
lib/html2rss/attribute_post_processors/parse_time.rb,
lib/html2rss/attribute_post_processors/sanitize_html.rb,
lib/html2rss/attribute_post_processors/html_to_markdown.rb,
lib/html2rss/attribute_post_processors/markdown_to_html.rb,
lib/html2rss/attribute_post_processors/html_transformers/wrap_img_in_a.rb,
lib/html2rss/attribute_post_processors/html_transformers/transform_urls_to_absolute_ones.rb

Overview

Provides a namespace for attribute post processors.

Defined Under Namespace

Modules: HtmlTransformers Classes: Base, Gsub, HtmlToMarkdown, InvalidType, MarkdownToHtml, MissingOption, ParseTime, ParseUri, SanitizeHtml, Substring, Template, UnknownPostProcessorName

Constant Summary collapse

NAME_TO_CLASS =

Maps the post processor name to the class implementing the post processor.

The key is the name to use in the feed config.

{
  gsub: Gsub,
  html_to_markdown: HtmlToMarkdown,
  markdown_to_html: MarkdownToHtml,
  parse_time: ParseTime,
  parse_uri: ParseUri,
  sanitize_html: SanitizeHtml,
  substring: Substring,
  template: Template
}.freeze

Class Method Summary collapse

Class Method Details

.get_processor(name) ⇒ Class

Retrieves the attribute post processor class based on the given name.

Parameters:

  • name (Symbol)

    The name of the post processor.

Returns:

  • (Class)

    The attribute post processor class.

Raises:



40
41
42
# File 'lib/html2rss/attribute_post_processors.rb', line 40

def self.get_processor(name)
  NAME_TO_CLASS[name.to_sym] || raise(UnknownPostProcessorName, "Can't find a post processor named '#{name}'")
end