Module: ArticleJSON::Export::Common::HTML::Elements::Base

Included in:
AMP::Elements::Base, HTML::Elements::Base
Defined in:
lib/article_json/export/common/html/elements/base.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Extend ‘base` class with `ClassMethods` upon inclusion



8
9
10
# File 'lib/article_json/export/common/html/elements/base.rb', line 8

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#exportNokogiri::XML::NodeSet

Export a HTML node out of the given element Dynamically looks up the right export-element-class, instantiates it and then calls the #build method.

Returns:

  • (Nokogiri::XML::NodeSet)


21
22
23
# File 'lib/article_json/export/common/html/elements/base.rb', line 21

def export
  exporter.export unless exporter.nil?
end

#initialize(element) ⇒ Object

Parameters:



13
14
15
# File 'lib/article_json/export/common/html/elements/base.rb', line 13

def initialize(element)
  @element = element
end