class ArticleJSON::Export::PlainText::Elements::Base

Public Class Methods

namespace() click to toggle source

Return the module namespace this class and its subclasses are nested in @return [Module]

# File lib/article_json/export/plain_text/elements/base.rb, line 22
def namespace
  ArticleJSON::Export::PlainText::Elements
end

Private Class Methods

default_exporter_mapping() click to toggle source
# File lib/article_json/export/plain_text/elements/base.rb, line 36
def default_exporter_mapping
  {
    text: namespace::Text,
    paragraph: namespace::Paragraph,
    heading: namespace::Heading,
    list: namespace::List,
    quote: namespace::Quote,
    image: nil,
    embed: nil,
    text_box: nil,
  }
end
export_format() click to toggle source

The format this exporter is returning. This is used to determine which custom element exporters should be applied from the configuration. @return [Symbol]

# File lib/article_json/export/plain_text/elements/base.rb, line 32
def export_format
  :plain_text
end

Public Instance Methods

export() click to toggle source

Export the given element. Dynamically looks up the right export-element-class, instantiates it and then calls the `#export` method. Defaults to an empty string, e.g. if no exporter is specified for the given type. @return [String]

# File lib/article_json/export/plain_text/elements/base.rb, line 14
def export
  super || ''
end