Class: Dato::DastNode

Inherits:
Node
  • Object
show all
Defined in:
app/components/dato/dast_node.rb

Instance Attribute Summary

Attributes inherited from Node

#root

Instance Method Summary collapse

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_tagObject



13
14
15
# File 'app/components/dato/dast_node.rb', line 13

def generated_tag
  @type
end