Class: Essence::TableComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Essence::TableComponent
- Defined in:
- app/components/essence/table_component.rb
Defined Under Namespace
Classes: Column
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
- #column(label) ⇒ Object
-
#initialize(rows: [], **html_options) ⇒ TableComponent
constructor
A new instance of TableComponent.
Methods inherited from ApplicationComponent
Methods included from Utils
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #integer_or_fallback
Constructor Details
#initialize(rows: [], **html_options) ⇒ TableComponent
7 8 9 10 11 |
# File 'app/components/essence/table_component.rb', line 7 def initialize(rows: [], **) @columns = [] @rows = rows = end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
5 6 7 |
# File 'app/components/essence/table_component.rb', line 5 def columns @columns end |
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
5 6 7 |
# File 'app/components/essence/table_component.rb', line 5 def end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
5 6 7 |
# File 'app/components/essence/table_component.rb', line 5 def rows @rows end |
Instance Method Details
#column(label) ⇒ Object
13 14 15 |
# File 'app/components/essence/table_component.rb', line 13 def column(label, &) @columns << Column.new(label, &) end |