Class: Dato::Node
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Dato::Node
show all
- Defined in:
- app/components/dato/node.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(node, root = nil) ⇒ Node
Returns a new instance of Node.
7
8
9
10
|
# File 'app/components/dato/node.rb', line 7
def initialize(node, root = nil)
@node = node
@root = root
end
|
Instance Attribute Details
#root ⇒ Object
Returns the value of attribute root.
5
6
7
|
# File 'app/components/dato/node.rb', line 5
def root
@root
end
|
Instance Method Details
#blocks ⇒ Object
16
17
18
|
# File 'app/components/dato/node.rb', line 16
def blocks
root.blocks
end
|
#debug_node ⇒ Object
24
25
26
|
# File 'app/components/dato/node.rb', line 24
def debug_node
content_tag("pre", JSON.pretty_generate(@node))
end
|
#overrides ⇒ Object
20
21
22
|
# File 'app/components/dato/node.rb', line 20
def overrides
root.overrides
end
|
#render_node(node) ⇒ Object
12
13
14
|
# File 'app/components/dato/node.rb', line 12
def render_node(node)
render class_for_node(node).new(node, root)
end
|