Class: SdrViewComponents::Elements::CardComponent

Inherits:
BaseComponent
  • Object
show all
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

Instance Method Summary collapse

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

#dataObject (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

#styleObject (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

#classesObject



21
22
23
# File 'app/components/sdr_view_components/elements/card_component.rb', line 21

def classes
  merge_classes('card', @classes)
end