Class: Heading::HComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/heading/h_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ HComponent

Returns a new instance of HComponent.



5
6
7
8
9
10
# File 'app/components/heading/h_component.rb', line 5

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

Instance Method Details

#callObject



12
13
14
15
16
17
18
# File 'app/components/heading/h_component.rb', line 12

def call
  (@tag,
    content || @text,
    class: @classes,
    style: @styles
  )
end