Class: UI::H1Component

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/view_components/ui/h1_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(classes: nil, **attributes) ⇒ H1Component

Returns a new instance of H1Component.

Parameters:

  • classes (String) (defaults to: nil)

    Additional CSS classes



6
7
8
9
# File 'app/view_components/ui/h1_component.rb', line 6

def initialize(classes: nil, **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'app/view_components/ui/h1_component.rb', line 11

def call
  extend UI::H1Behavior

  attrs = h1_html_attributes

   :h1, **attrs.merge(@attributes) do
    content
  end
end