Class: NitroKit::Textarea

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

Instance Attribute Summary collapse

Attributes inherited from Component

#attrs

Instance Method Summary collapse

Methods inherited from Component

#builder, from_template

Constructor Details

#initialize(value: nil, **attrs) ⇒ Textarea

Returns a new instance of Textarea.



5
6
7
8
9
10
11
12
# File 'app/components/nitro_kit/textarea.rb', line 5

def initialize(value: nil, **attrs)
  @value = value

  super(
    attrs,
    class: default_class
  )
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14
15
16
# File 'app/components/nitro_kit/textarea.rb', line 14

def value
  @value
end

Instance Method Details

#view_templateObject



16
17
18
# File 'app/components/nitro_kit/textarea.rb', line 16

def view_template
  textarea(**attrs) { plain(value) }
end