Class: SdrViewComponents::Tables::ListCellComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/sdr_view_components/tables/list_cell_component.rb

Overview

Component for rendering a list in a table cell.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#args_for, #merge_actions, #merge_classes

Constructor Details

#initialize(item_values: []) ⇒ ListCellComponent

Returns a new instance of ListCellComponent.



9
10
11
12
13
# File 'app/components/sdr_view_components/tables/list_cell_component.rb', line 9

def initialize(item_values: [])
  # Provide items or item_values
  @item_values = item_values
  super()
end

Instance Attribute Details

#item_valuesObject (readonly)

Returns the value of attribute item_values.



15
16
17
# File 'app/components/sdr_view_components/tables/list_cell_component.rb', line 15

def item_values
  @item_values
end

Instance Method Details

#list_itemsObject



17
18
19
# File 'app/components/sdr_view_components/tables/list_cell_component.rb', line 17

def list_items
  items? ? items : item_values
end