Class: UI::H2Component

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of H2Component.

Parameters:

  • classes (String) (defaults to: nil)

    Additional CSS classes



6
7
8
9
# File 'app/view_components/ui/h2_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/h2_component.rb', line 11

def call
  extend UI::H2Behavior

  attrs = h2_html_attributes

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