Class: ArticleJSON::Export::FacebookInstantArticle::Elements::TextBox

Inherits:
Base
  • Object
show all
Includes:
Common::HTML::Elements::TextBox
Defined in:
lib/article_json/export/facebook_instant_article/elements/text_box.rb

Instance Method Summary collapse

Methods included from Common::HTML::Elements::Shared::Float

#floating_class

Methods inherited from Base

namespace

Methods included from Common::HTML::Elements::Base

included

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate a ‘<div>` node containing all text box elements and surrounded by an ASCII-art line to the top and bottom

Returns:

  • (Nokogiri::XML::NodeSet)


11
12
13
14
15
16
17
18
19
# File 'lib/article_json/export/facebook_instant_article/elements/text_box.rb', line 11

def export
  create_element(:div, class: 'text-box') do |div|
    div.add_child(ascii_art_line_node)
    @element.content.each do |child_element|
      div.add_child(base_class.new(child_element).export)
    end
    div.add_child(ascii_art_line_node)
  end
end