Class: Avo::Resources::Items::Row

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

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Attributes included from Concerns::IsResourceItem

#resource

Instance Method Summary collapse

Methods included from Concerns::Hydration

#hydrate

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?

Constructor Details

#initialize(view: nil) ⇒ Row

Returns a new instance of Row.



15
16
17
18
# File 'lib/avo/resources/items/row.rb', line 15

def initialize(view: nil)
  @view = Avo::ViewInquirer.new view
  @items_holder = Avo::Resources::Items::Holder.new
end

Instance Attribute Details

#items_holderObject

Returns the value of attribute items_holder.



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

def items_holder
  @items_holder
end

#viewObject (readonly)

Returns the value of attribute view.



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

def view
  @view
end

Instance Method Details

#has_items?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/avo/resources/items/row.rb', line 20

def has_items?
  @items.present?
end