class ArticleJSON::Export::PlainText::Elements::Paragraph

Public Instance Methods

export() click to toggle source

Plain text from the paragraph. Any formatting is disregarded. Followed by a newline. @return [String]

# File lib/article_json/export/plain_text/elements/paragraph.rb, line 9
def export
  "#{text}\n"
end

Private Instance Methods

text() click to toggle source

Plain text of the paragraph @return [String]

# File lib/article_json/export/plain_text/elements/paragraph.rb, line 17
def text
  @element
    .content
    &.map { |text_element| text_exporter.new(text_element).export }
    &.join
end
text_exporter() click to toggle source

Get the exporter class for text elements @return [ArticleJSON::Export::PlainText::Elements::Base]

# File lib/article_json/export/plain_text/elements/paragraph.rb, line 26
def text_exporter
  self.class.exporter_by_type(:text)
end