class ArticleJSON::Export::PlainText::Exporter

Public Class Methods

new(elements) click to toggle source

@param [Array] elements

# File lib/article_json/export/plain_text/exporter.rb, line 6
def initialize(elements)
  @elements = elements
end

Public Instance Methods

text() click to toggle source

Generate a string with the plain text representation of all elements @return [String]

# File lib/article_json/export/plain_text/exporter.rb, line 12
def text
  @text ||=
    @elements.map do |element|
      ArticleJSON::Export::PlainText::Elements::Base
        .build(element)
        &.export
    end.join.strip
end