Class: ArticleJSON::Export::FacebookInstantArticle::Elements::Embed

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

Instance Method Summary collapse

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

#caption_node

Methods inherited from Base

namespace

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

included

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate the embedded element node

Returns:

  • (Nokogiri::XML::NodeSet)


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

def export
  create_element(:figure, class: 'op-interactive') do |figure|
    figure.add_child(embed_node)
    if @element.caption&.any?
      figure.add_child(caption_node(:figcaption))
    end
  end
end