Class: SdrViewComponents::Tables::CellComponent

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

Overview

Component for rendering a table cell.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#args_for, #merge_actions, #merge_classes

Constructor Details

#initialize(colspan: nil, classes: [], **cell_options) ⇒ CellComponent

Returns a new instance of CellComponent.



7
8
9
10
11
12
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 7

def initialize(colspan: nil, classes: [], **cell_options)
  @colspan = colspan
  @classes = classes
  @cell_options = cell_options
  super()
end

Instance Attribute Details

#cell_optionsObject (readonly)

Returns the value of attribute cell_options.



14
15
16
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 14

def cell_options
  @cell_options
end

#colspanObject (readonly)

Returns the value of attribute colspan.



14
15
16
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 14

def colspan
  @colspan
end

Instance Method Details

#classesObject



16
17
18
# File 'app/components/sdr_view_components/tables/cell_component.rb', line 16

def classes
  merge_classes(@classes)
end