Class: NitroKit::Fieldset

Inherits:
Component
  • Object
show all
Defined in:
app/components/nitro_kit/fieldset.rb

Constant Summary collapse

FIELDSET_BASE =
"space-y-6"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#data_merge, merge, #merge

Constructor Details

#initialize(legend, **attrs) ⇒ Fieldset

Returns a new instance of Fieldset.



5
6
7
8
# File 'app/components/nitro_kit/fieldset.rb', line 5

def initialize(legend, **attrs)
  @legend = legend
  @attrs = attrs
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'app/components/nitro_kit/fieldset.rb', line 10

def attrs
  @attrs
end

#legendObject (readonly)

Returns the value of attribute legend.



10
11
12
# File 'app/components/nitro_kit/fieldset.rb', line 10

def legend
  @legend
end

Instance Method Details

#view_template(&block) ⇒ Object



12
13
14
# File 'app/components/nitro_kit/fieldset.rb', line 12

def view_template(&block)
  fieldset(**attrs, class: FIELDSET_BASE, &block)
end