module ArticleJSON::Export::Common::HTML::Elements::Paragraph

Public Instance Methods

export() click to toggle source

Generate the paragraph node with its containing text elements @return [Nokogiri::XML::NodeSet]

# File lib/article_json/export/common/html/elements/paragraph.rb, line 9
def export
  create_element(:p) do |p|
    @element.content.each do |child_element|
      p.add_child(text_exporter.new(child_element).export)
    end
  end
end

Private Instance Methods

text_exporter() click to toggle source

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

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