Class: Avo::Resources::Items::ItemGroup

Inherits:
Object
  • Object
show all
Includes:
Concerns::HasItemType, Concerns::HasItems, Concerns::IsResourceItem, Concerns::IsVisible, Concerns::VisibleInDifferentViews, Concerns::VisibleItems
Defined in:
lib/avo/resources/items/item_group.rb

Direct Known Subclasses

Panel

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Attributes included from Concerns::IsVisible

#visible

Attributes included from Concerns::VisibleInDifferentViews

#show_on_edit, #show_on_index, #show_on_new, #show_on_preview, #show_on_show

Attributes included from Concerns::HasItems

#items_holder

Attributes included from Concerns::IsResourceItem

#resource, #view

Instance Method Summary collapse

Methods included from Concerns::IsVisible

#visible?

Methods included from Concerns::VisibleInDifferentViews

#except_on, #hide_on, #initialize_views, #only_on, #post_initialize, #show_on, #show_on_create, #show_on_update, #visible_in_view?

Methods included from Concerns::VisibleItems

#visible?

Methods included from Concerns::HasItemType

#is_field?, #is_heading?, #is_main_panel?, #is_panel?, #is_row?, #is_sidebar?, #is_tab?, #is_tab_group?, #is_tool?

Methods included from Concerns::HasItems

#fields, #get_field, #get_field_definitions, #get_fields, #get_items, #get_preview_fields, #invalid_fields, #is_empty?, #items, #only_fields, #tab_groups, #visible_items

Methods included from Concerns::IsResourceItem

#visible?

Methods included from Concerns::Hydration

#hydrate

Constructor Details

#initialize(name: nil, description: nil, view: nil, **args) ⇒ ItemGroup

Returns a new instance of ItemGroup.



15
16
17
18
19
20
21
22
23
24
# File 'lib/avo/resources/items/item_group.rb', line 15

def initialize(name: nil, description: nil, view: nil, **args)
  @name = name
  @view = Avo::ViewInquirer.new view
  @description = description
  @items_holder = Avo::Resources::Items::Holder.new
  @args = args
  @visible = args[:visible]

  post_initialize if respond_to?(:post_initialize)
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/avo/resources/items/item_group.rb', line 11

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/avo/resources/items/item_group.rb', line 10

def name
  @name
end