Class: Arara::DataTableHeaderCellComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::DataTableHeaderCellComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/data_table_header_cell_component.rb
Instance Attribute Summary collapse
-
#numeric ⇒ Object
readonly
Returns the value of attribute numeric.
Instance Method Summary collapse
- #default_html_class ⇒ Object
- #html_options ⇒ Object
-
#initialize(numeric: false, **kw) ⇒ DataTableHeaderCellComponent
constructor
A new instance of DataTableHeaderCellComponent.
Methods included from BaseComponent
#default_data_controller, #default_html_tag, #html_class, #html_content, #html_data, #html_tag, included
Constructor Details
#initialize(numeric: false, **kw) ⇒ DataTableHeaderCellComponent
Returns a new instance of DataTableHeaderCellComponent.
8 9 10 11 |
# File 'app/components/arara/data_table_header_cell_component.rb', line 8 def initialize(numeric: false, **kw) super(tag: "th", **kw) @numeric = numeric end |
Instance Attribute Details
#numeric ⇒ Object (readonly)
Returns the value of attribute numeric.
4 5 6 |
# File 'app/components/arara/data_table_header_cell_component.rb', line 4 def numeric @numeric end |
Instance Method Details
#default_html_class ⇒ Object
13 14 15 16 |
# File 'app/components/arara/data_table_header_cell_component.rb', line 13 def default_html_class return "mdc-data-table__header-cell mdc-data-table__header-cell--numeric" if numeric "mdc-data-table__header-cell" end |
#html_options ⇒ Object
18 19 20 21 22 |
# File 'app/components/arara/data_table_header_cell_component.rb', line 18 def opts = super opts.merge!(role: "columnheader", scope: "col") opts end |