Class: EasyAdmin::Layouts::Nodes::Root
- 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
- #form_layout? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Root
constructor
A new instance of Root.
- #layout_type ⇒ Object
- #show_layout? ⇒ Boolean
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
15 16 17 |
# File 'lib/easy_admin/layouts/nodes/root.rb', line 15 def form_layout? layout_type == :form end |
#layout_type ⇒ Object
11 12 13 |
# File 'lib/easy_admin/layouts/nodes/root.rb', line 11 def layout_type @attributes[:layout_type] end |
#show_layout? ⇒ Boolean
19 20 21 |
# File 'lib/easy_admin/layouts/nodes/root.rb', line 19 def show_layout? layout_type == :show end |