Class: SdrViewComponents::Elements::CardComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- SdrViewComponents::Elements::CardComponent
- Defined in:
- app/components/sdr_view_components/elements/card_component.rb
Overview
Component for a card
Defined Under Namespace
Classes: SectionComponent
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(classes: [], style: nil, data: {}) ⇒ CardComponent
constructor
A new instance of CardComponent.
Methods inherited from BaseComponent
#args_for, #merge_actions, #merge_classes
Constructor Details
#initialize(classes: [], style: nil, data: {}) ⇒ CardComponent
Returns a new instance of CardComponent.
14 15 16 17 18 19 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 14 def initialize(classes: [], style: nil, data: {}) @classes = classes @style = style @data = data super() end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
25 26 27 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 25 def data @data end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
25 26 27 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 25 def style @style end |
Instance Method Details
#classes ⇒ Object
21 22 23 |
# File 'app/components/sdr_view_components/elements/card_component.rb', line 21 def classes merge_classes('card', @classes) end |