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

Included in:
AppleNews::Elements::Base, PlainText::Elements::Base
Defined in:
lib/article_json/export/common/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



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

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

Instance Method Details

#exportObject

Export the given element. Dynamically looks up the right export-element-class, instantiates it and then calls the ‘#export` method.

Returns:

  • (Object)


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

def export
  exporter.export unless exporter.nil?
end

#initialize(element) ⇒ Object

Parameters:



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

def initialize(element)
  @element = element
end