Class: FoxTail::HrComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::HrComponent
- Defined in:
- app/components/fox_tail/hr_component.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/fox_tail/hr_component.rb', line 12 def call content_tag :div, class: wrapper_classes do if content? && shape == :none concat tag.hr(class: hr_classes) concat content_tag(:div, content, class: content_classes) concat tag.hr(class: hr_classes) else tag.hr(class: hr_classes) end end end |
#shape? ⇒ Boolean
8 9 10 |
# File 'app/components/fox_tail/hr_component.rb', line 8 def shape? shape != :none end |