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
-
.included(base) ⇒ Object
Extend ‘base` class with `ClassMethods` upon inclusion.
Instance Method Summary collapse
-
#export ⇒ Object
Export the given element.
- #initialize(element) ⇒ Object
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
#export ⇒ Object
Export the given element. Dynamically looks up the right export-element-class, instantiates it and then calls the ‘#export` method.
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
12 13 14 |
# File 'lib/article_json/export/common/elements/base.rb', line 12 def initialize(element) @element = element end |