Class: Heading::HComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Heading::HComponent
- Defined in:
- app/components/heading/h_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**options) ⇒ HComponent
constructor
A new instance of HComponent.
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(**) @text = [:text] @tag = [:tag] @classes = [:classes] @styles = [:styles] end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/components/heading/h_component.rb', line 12 def call content_tag(@tag, content || @text, class: @classes, style: @styles ) end |