Class: Dato::Heading

Inherits:
DastNode show all
Defined in:
app/components/dato/heading.rb

Instance Attribute Summary

Attributes inherited from Node

#node, #parent, #root

Instance Method Summary collapse

Methods inherited from Node

#blocks, #debug_node, #find_ancestor, #links, #node_type, #overrides, #parent_type, #render_node

Constructor Details

#initialize(node, root, parent = nil) ⇒ Heading

Returns a new instance of Heading.



4
5
6
# File 'app/components/dato/heading.rb', line 4

def initialize(node, root, parent = nil)
  super(node, "heading", root, parent)
end

Instance Method Details

#generated_tagObject



12
13
14
# File 'app/components/dato/heading.rb', line 12

def generated_tag
  "h#{level}"
end

#levelObject



8
9
10
# File 'app/components/dato/heading.rb', line 8

def level
  @node.level
end