Class: SdrViewComponents::Tables::HeaderComponent

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

Overview

Component for rendering a table header.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#args_for, #merge_actions, #merge_classes

Constructor Details

#initialize(label:, classes: [], tooltip: nil, **header_options) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



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

def initialize(label:, classes: [], tooltip: nil, **header_options)
  @label = label
  @classes = classes
  @tooltip = tooltip
  @header_options = header_options
  super()
end

Instance Attribute Details

#header_optionsObject (readonly)

Returns the value of attribute header_options.



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

def header_options
  @header_options
end

#labelObject (readonly)

Returns the value of attribute label.



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

def label
  @label
end

#tooltipObject (readonly)

Returns the value of attribute tooltip.



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

def tooltip
  @tooltip
end

Instance Method Details

#classesObject



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

def classes
  merge_classes(@classes)
end