Class: FlexiAdmin::Components::Resources::ListView::CellComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- FlexiAdmin::Components::Resources::ListView::CellComponent
- Defined in:
- lib/flexi_admin/components/resources/list_view/cell_component.rb
Instance Attribute Summary collapse
-
#justify ⇒ Object
readonly
Returns the value of attribute justify.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(value, width: nil, **options) ⇒ CellComponent
constructor
A new instance of CellComponent.
- #justify_class ⇒ Object
- #merged_classes ⇒ Object
- #width_class ⇒ Object
Constructor Details
#initialize(value, width: nil, **options) ⇒ CellComponent
Returns a new instance of CellComponent.
7 8 9 10 11 12 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 7 def initialize(value, width: nil, **) @value = value @width = width @options = @justify = [:justify] end |
Instance Attribute Details
#justify ⇒ Object (readonly)
Returns the value of attribute justify.
5 6 7 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 5 def justify @justify end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 5 def @options end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 5 def value @value end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
5 6 7 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 5 def width @width end |
Instance Method Details
#justify_class ⇒ Object
18 19 20 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 18 def justify_class justify ? "text-#{justify}" : "" end |
#merged_classes ⇒ Object
22 23 24 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 22 def merged_classes [width_class, justify_class].join(" ") end |
#width_class ⇒ Object
14 15 16 |
# File 'lib/flexi_admin/components/resources/list_view/cell_component.rb', line 14 def width_class width ? "col-#{width}" : "col" end |