Class: Dato::DastNode
- Defined in:
- app/components/dato/dast_node.rb
Direct Known Subclasses
Block, Blockquote, Code, Heading, Link, List, ListItem, NotRendered, Paragraph, Span, ThematicBreak, UnknownNode
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #generated_tag ⇒ Object
-
#initialize(node, type, root = nil) ⇒ DastNode
constructor
A new instance of DastNode.
Methods inherited from Node
#blocks, #debug_node, #overrides, #render_node
Constructor Details
#initialize(node, type, root = nil) ⇒ DastNode
Returns a new instance of DastNode.
5 6 7 8 9 10 11 |
# File 'app/components/dato/dast_node.rb', line 5 def initialize(node, type, root = nil) super(node, root) unless node.type == type raise ArgumentError.new("The node type is '#{node.type}' instead of '#{type}'") end @type = type end |
Instance Method Details
#generated_tag ⇒ Object
13 14 15 |
# File 'app/components/dato/dast_node.rb', line 13 def generated_tag @type end |