Class: Practical::Views::Form::FieldsetTitleComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/practical/views/form/fieldset_title_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options: {}) ⇒ FieldsetTitleComponent

Returns a new instance of FieldsetTitleComponent.



7
8
9
# File 'app/components/practical/views/form/fieldset_title_component.rb', line 7

def initialize(options: {})
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'app/components/practical/views/form/fieldset_title_component.rb', line 4

def options
  @options
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'app/components/practical/views/form/fieldset_title_component.rb', line 11

def call
  tag.span(**mix({}, options)) {
    safe_join([
      (icon if icon?),
      " ",
      tag.span{ content }
    ])
  }
end