Class: Avo::Resources::Items::Tab
- Inherits:
-
Object
- Object
- Avo::Resources::Items::Tab
- Includes:
- Concerns::HasItemType, Concerns::HasItems, Concerns::IsResourceItem, Concerns::IsVisible, Concerns::VisibleInDifferentViews, Concerns::VisibleItems
- Defined in:
- lib/avo/resources/items/tab.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
Attributes included from Concerns::VisibleInDifferentViews
#show_on_edit, #show_on_index, #show_on_new, #show_on_preview, #show_on_show
Attributes included from Concerns::IsVisible
Attributes included from Concerns::HasItems
Attributes included from Concerns::IsResourceItem
Instance Method Summary collapse
- #id ⇒ Object (also: #to_param)
-
#initialize(name: nil, description: nil, view: nil, **args) ⇒ Tab
constructor
A new instance of Tab.
- #name ⇒ Object
- #turbo_frame_id(parent: nil) ⇒ Object
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::IsVisible
Methods included from Concerns::VisibleItems
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
Methods included from Concerns::Hydration
Constructor Details
#initialize(name: nil, description: nil, view: nil, **args) ⇒ Tab
Returns a new instance of Tab.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/avo/resources/items/tab.rb', line 14 def initialize(name: nil, description: nil, view: nil, **args) @name = name @description = description @items_holder = Avo::Resources::Items::Holder.new @view = Avo::ViewInquirer.new view @args = args @visible = args[:visible] post_initialize if respond_to?(:post_initialize) end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/avo/resources/items/tab.rb', line 12 def description @description end |
Instance Method Details
#id ⇒ Object Also known as: to_param
29 30 31 |
# File 'lib/avo/resources/items/tab.rb', line 29 def id name.to_s.parameterize end |
#name ⇒ Object
25 26 27 |
# File 'lib/avo/resources/items/tab.rb', line 25 def name Avo::ExecutionContext.new(target: @name).handle end |