Class: DaisyUI::Card::Title
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DaisyUI::Card::Title
- Defined in:
- app/components/daisy_ui/data_display/card/title.rb
Overview
Title component for the card, handling the title display
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text = nil, tag_name: :h2, **system_arguments) ⇒ Title
constructor
A new instance of Title.
Constructor Details
#initialize(text = nil, tag_name: :h2, **system_arguments) ⇒ Title
31 32 33 34 35 |
# File 'app/components/daisy_ui/data_display/card/title.rb', line 31 def initialize(text = nil, tag_name: :h2, **system_arguments) @text = text @tag_name = tag_name super(**system_arguments) end |
Instance Method Details
#call ⇒ Object
37 38 39 40 41 |
# File 'app/components/daisy_ui/data_display/card/title.rb', line 37 def call content_tag(@tag_name, **html_attributes) do content || @text end end |