Class: Practical::Views::TiptapDocumentComponent::Node
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Practical::Views::TiptapDocumentComponent::Node
- Includes:
- NodeRendering
- Defined in:
- app/components/practical/views/tiptap_document_component.rb
Direct Known Subclasses
Attachment, Blockquote, CodeBlock, HardBreak, Heading, ListItem, OrderedList, Paragraph, Text, UnorderedList
Instance Attribute Summary collapse
-
#node_content ⇒ Object
readonly
Returns the value of attribute node_content.
Instance Method Summary collapse
-
#initialize(node_content:) ⇒ Node
constructor
A new instance of Node.
- #render_node_contents ⇒ Object
Methods included from NodeRendering
Methods included from ElementHelper
Constructor Details
#initialize(node_content:) ⇒ Node
Returns a new instance of Node.
56 57 58 |
# File 'app/components/practical/views/tiptap_document_component.rb', line 56 def initialize(node_content:) @node_content = node_content end |
Instance Attribute Details
#node_content ⇒ Object (readonly)
Returns the value of attribute node_content.
54 55 56 |
# File 'app/components/practical/views/tiptap_document_component.rb', line 54 def node_content @node_content end |
Instance Method Details
#render_node_contents ⇒ Object
60 61 62 63 64 |
# File 'app/components/practical/views/tiptap_document_component.rb', line 60 def render_node_contents if node_content.present? && node_content[:content].present? safe_join(node_content[:content].map{|node| render_node(node: node)}) end end |