Class: Practical::Views::Form::OptionLabelComponent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options: {}) ⇒ OptionLabelComponent

Returns a new instance of OptionLabelComponent.



8
9
10
# File 'app/components/practical/views/form/option_label_component.rb', line 8

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

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'app/components/practical/views/form/option_label_component.rb', line 6

def options
  @options
end

Instance Method Details

#callObject



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

def call
  tag.section(**mix({class: "wa-stack wa-size-s wa-gap-0"}, options)) {
    safe_join([
      tag.span(title),
      tag.small(description, class: "wa-quiet"),
    ])
  }
end