Class: NitroKit::Fieldset
- Defined in:
- app/components/nitro_kit/fieldset.rb
Constant Summary collapse
- FIELDSET_BASE =
"space-y-6"
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#legend ⇒ Object
readonly
Returns the value of attribute legend.
Instance Method Summary collapse
-
#initialize(legend, **attrs) ⇒ Fieldset
constructor
A new instance of Fieldset.
- #view_template(&block) ⇒ Object
Methods inherited from Component
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
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
10 11 12 |
# File 'app/components/nitro_kit/fieldset.rb', line 10 def attrs @attrs end |
#legend ⇒ Object (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 |