Class: SdrViewComponents::Elements::CardComponent::SectionComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- SdrViewComponents::Elements::CardComponent::SectionComponent
- Defined in:
- app/components/sdr_view_components/elements/card_component.rb
Overview
Component for a card section
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call ⇒ Object
- #classes ⇒ Object
-
#initialize(default_class:, classes: [], **options) ⇒ SectionComponent
constructor
A new instance of SectionComponent.
Methods inherited from BaseComponent
#args_for, #merge_actions, #merge_classes
Constructor Details
#initialize(default_class:, classes: [], **options) ⇒ SectionComponent
Returns a new instance of SectionComponent.
29 30 31 32 33 34 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 29 def initialize(default_class:, classes: [], **) @classes = classes @default_class = default_class @options = super() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
36 37 38 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 36 def @options end |
Instance Method Details
#call ⇒ Object
42 43 44 45 46 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 42 def call tag.div(class: classes, **) do content end end |
#classes ⇒ Object
38 39 40 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 38 def classes merge_classes(@default_class, @classes) end |