Class: Kanso::FormFieldComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/kanso/form_field_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(form:, attribute:, type: :text_field, **options) ⇒ FormFieldComponent

Returns a new instance of FormFieldComponent.



9
10
11
12
13
14
# File 'app/components/kanso/form_field_component.rb', line 9

def initialize(form:, attribute:, type: :text_field, **options)
  @form = form
  @attribute = attribute
  @type = type
  @options = options
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



7
8
9
# File 'app/components/kanso/form_field_component.rb', line 7

def attribute
  @attribute
end

#formObject (readonly)

Returns the value of attribute form.



7
8
9
# File 'app/components/kanso/form_field_component.rb', line 7

def form
  @form
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'app/components/kanso/form_field_component.rb', line 7

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'app/components/kanso/form_field_component.rb', line 7

def type
  @type
end