Class: Card::CardComponent::HeaderComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/card/card_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ HeaderComponent

Returns a new instance of HeaderComponent.



21
22
23
24
25
26
# File 'app/components/card/card_component.rb', line 21

def initialize(**options)
  @classes = options[:classes]
  @styles = options[:styles]

  @default_classses = 'card-header'
end

Instance Method Details

#callObject



28
29
30
31
32
33
34
35
36
37
# File 'app/components/card/card_component.rb', line 28

def call
  (:div,
    content,
    class: Card.default_plus_passed_classes(
      @default_classses,
      @classes
    ),
    style: @styles
  )
end