Class: Brainzlab::Components::Label

Inherits:
Base
  • Object
show all
Defined in:
lib/brainzlab/components/input.rb

Instance Method Summary collapse

Methods inherited from Base

#classes

Constructor Details

#initialize(for_input: nil, **attrs) ⇒ Label

Returns a new instance of Label.



32
33
34
35
# File 'lib/brainzlab/components/input.rb', line 32

def initialize(for_input: nil, **attrs)
  @for_input = for_input
  @attrs = attrs
end

Instance Method Details

#view_templateObject



37
38
39
40
41
42
43
44
# File 'lib/brainzlab/components/input.rb', line 37

def view_template(&)
  label(
    for: @for_input,
    class: classes('label', @attrs[:class]),
    **@attrs.except(:class),
    &
  )
end