Class: Nquery::CardTableComponent
- Defined in:
- app/components/nquery/card_table_component.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#html_class ⇒ Object
readonly
Returns the value of attribute html_class.
-
#table_class ⇒ Object
readonly
Returns the value of attribute table_class.
Instance Method Summary collapse
- #css_class ⇒ Object
-
#initialize(columns:, class: nil, table_class: "nq-table") ⇒ CardTableComponent
constructor
A new instance of CardTableComponent.
Methods inherited from Component
Constructor Details
#initialize(columns:, class: nil, table_class: "nq-table") ⇒ CardTableComponent
Returns a new instance of CardTableComponent.
7 8 9 10 11 |
# File 'app/components/nquery/card_table_component.rb', line 7 def initialize(columns:, class: nil, table_class: "nq-table") @columns = columns @html_class = binding.local_variable_get(:class) @table_class = table_class end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
5 6 7 |
# File 'app/components/nquery/card_table_component.rb', line 5 def columns @columns end |
#html_class ⇒ Object (readonly)
Returns the value of attribute html_class.
5 6 7 |
# File 'app/components/nquery/card_table_component.rb', line 5 def html_class @html_class end |
#table_class ⇒ Object (readonly)
Returns the value of attribute table_class.
5 6 7 |
# File 'app/components/nquery/card_table_component.rb', line 5 def table_class @table_class end |
Instance Method Details
#css_class ⇒ Object
13 14 15 16 17 |
# File 'app/components/nquery/card_table_component.rb', line 13 def css_class classes = ["nq-card", "nq-card-table"] classes << html_class if html_class.present? classes.join(" ") end |