Class: Coradoc::Html::Transform::FromCoreModel
- Inherits:
-
Object
- Object
- Coradoc::Html::Transform::FromCoreModel
- Defined in:
- lib/coradoc/html/transform/from_core_model.rb
Overview
Transforms CoreModel models to HTML output
This transformer converts CoreModel to structures suitable for HTML rendering. Note: The HTML converters already support CoreModel directly, so this transformer primarily passes through the CoreModel.
Class Method Summary collapse
-
.transform(model) ⇒ Object
Transform a CoreModel to HTML-ready structure.
Class Method Details
.transform(model) ⇒ Object
Transform a CoreModel to HTML-ready structure
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/coradoc/html/transform/from_core_model.rb', line 17 def transform(model) case model when Coradoc::CoreModel::Base # HTML converters already support CoreModel directly model when Array model.map { |item| transform(item) } else model end end |