Class: FComponents::FormField::Component

Inherits:
Base
  • Object
show all
Defined in:
app/components/f_components/form_field/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

call

Methods included from ComponentsHelper

#component, #fcomponent

Constructor Details

#initialize(form, attribute_name, **options) ⇒ Component

Returns a new instance of Component.



8
9
10
11
12
13
14
# File 'app/components/f_components/form_field/component.rb', line 8

def initialize(form, attribute_name, **options)
  @form = form
  @attribute_name = attribute_name
  @options = options

  define_elements_classes
end

Instance Attribute Details

#attribute_nameObject (readonly)

Returns the value of attribute attribute_name.



6
7
8
# File 'app/components/f_components/form_field/component.rb', line 6

def attribute_name
  @attribute_name
end

#formObject (readonly)

Returns the value of attribute form.



6
7
8
# File 'app/components/f_components/form_field/component.rb', line 6

def form
  @form
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'app/components/f_components/form_field/component.rb', line 6

def options
  @options
end