Module: Coradoc::Mirror::Handlers::Frontmatter
- Defined in:
- lib/coradoc/mirror/handlers/frontmatter.rb
Overview
Handles FrontmatterBlock → frontmatter node.
Walks the CoreModel data hash and builds a typed tree of FrontmatterEntry / FrontmatterValue nodes. Dates/times are ISO 8601-encoded so the wire shape is JSON-native.
Class Method Summary collapse
Class Method Details
.call(element) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/coradoc/mirror/handlers/frontmatter.rb', line 12 def self.call(element, *) entries = build_entries(element.data || {}) Node::Frontmatter.new( attrs: Node::Frontmatter::Attrs.new( schema: element.schema, entries: entries ) ) end |