Class: Avo::Panel
- Inherits:
-
Object
- Object
- Avo::Panel
- Includes:
- Concerns::IsResourceItem, Concerns::VisibleItems
- Defined in:
- lib/avo/panel.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#items_holder ⇒ Object
Returns the value of attribute items_holder.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
- #add_item(item) ⇒ Object
- #has_items? ⇒ Boolean
-
#initialize(name: nil, description: nil, view: nil) ⇒ Panel
constructor
A new instance of Panel.
Methods included from Concerns::VisibleItems
#hydrate, #items, #visible, #visible?, #visible_items
Methods included from Concerns::IsResourceItem
#is_field?, #is_main_panel?, #is_panel?, #is_sidebar?, #is_tab?, #is_tab_group?, #is_tool?
Constructor Details
#initialize(name: nil, description: nil, view: nil) ⇒ Panel
Returns a new instance of Panel.
14 15 16 17 18 19 |
# File 'lib/avo/panel.rb', line 14 def initialize(name: nil, description: nil, view: nil) @name = name @view = view @description = description @items_holder = Avo::ItemsHolder.new end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/avo/panel.rb', line 9 def description @description end |
#items_holder ⇒ Object
Returns the value of attribute items_holder.
10 11 12 |
# File 'lib/avo/panel.rb', line 10 def items_holder @items_holder end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/avo/panel.rb', line 7 def name @name end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
8 9 10 |
# File 'lib/avo/panel.rb', line 8 def view @view end |
Instance Method Details
#add_item(item) ⇒ Object
21 22 23 |
# File 'lib/avo/panel.rb', line 21 def add_item(item) @items << item end |
#has_items? ⇒ Boolean
25 26 27 |
# File 'lib/avo/panel.rb', line 25 def has_items? @items.present? end |