Class: Coradoc::Mirror::ReverseBuilder::CodeBlock

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/mirror/reverse_builder.rb

Instance Attribute Summary

Attributes inherited from Base

#context

Instance Method Summary collapse

Methods inherited from Base

#apply_mark, #build_content, #build_inline_children, #build_node, #extract_text, #initialize, #inline_content, registers

Constructor Details

This class inherits a constructor from Coradoc::Mirror::ReverseBuilder::Base

Instance Method Details

#build(node) ⇒ Object



158
159
160
161
162
163
164
165
# File 'lib/coradoc/mirror/reverse_builder.rb', line 158

def build(node)
  attrs = node.attrs
  CoreModel::SourceBlock.new(
    content: attrs&.text || extract_text(node),
    language: attrs&.language,
    title: attrs&.title
  )
end