Class: Practical::Views::Form::FieldTitleComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Practical::Views::Form::FieldTitleComponent
- Defined in:
- app/components/practical/views/form/field_title_component.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #call ⇒ Object
- #flank_class ⇒ Object
-
#initialize(options: {}) ⇒ FieldTitleComponent
constructor
A new instance of FieldTitleComponent.
Constructor Details
#initialize(options: {}) ⇒ FieldTitleComponent
Returns a new instance of FieldTitleComponent.
7 8 9 |
# File 'app/components/practical/views/form/field_title_component.rb', line 7 def initialize(options: {}) self. = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/components/practical/views/form/field_title_component.rb', line 4 def @options end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/components/practical/views/form/field_title_component.rb', line 15 def call tag.section(**mix({class: [flank_class, "field-title"]}, )) { safe_join([ (icon if icon?), tag.div{ content } ]) } end |
#flank_class ⇒ Object
11 12 13 |
# File 'app/components/practical/views/form/field_title_component.rb', line 11 def flank_class return "wa-flank" if icon? end |