Class: EasyAdmin::Layouts::Nodes::Root

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/easy_admin/layouts/nodes/root.rb

Overview

Root node of the layout AST

Instance Attribute Summary

Attributes inherited from BaseNode

#attributes, #children, #metadata, #visible_if

Instance Method Summary collapse

Methods inherited from BaseNode

#[], #[]=, #accept, #add_child, #children?, #node_type, #visible?

Constructor Details

#initialize(attributes = {}) ⇒ Root

Returns a new instance of Root.



6
7
8
9
# File 'lib/easy_admin/layouts/nodes/root.rb', line 6

def initialize(attributes = {})
  super
  @attributes[:layout_type] = attributes[:layout_type] || :show
end

Instance Method Details

#form_layout?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/easy_admin/layouts/nodes/root.rb', line 15

def form_layout?
  layout_type == :form
end

#layout_typeObject



11
12
13
# File 'lib/easy_admin/layouts/nodes/root.rb', line 11

def layout_type
  @attributes[:layout_type]
end

#show_layout?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/easy_admin/layouts/nodes/root.rb', line 19

def show_layout?
  layout_type == :show
end