Class: Uchi::Field::Base::Edit

Inherits:
Component
  • Object
show all
Defined in:
app/components/uchi/field/base.rb

Overview

Uchi::Field::Base::Edit components render fields in the edit view.

Instance Attribute Summary collapse

Attributes inherited from Component

#field, #record, #repository

Instance Method Summary collapse

Methods inherited from Component

#value

Constructor Details

#initialize(field:, form:, repository:, label: nil, hint: nil) ⇒ Edit

Returns a new instance of Edit.



30
31
32
33
34
35
# File 'app/components/uchi/field/base.rb', line 30

def initialize(field:, form:, repository:, label: nil, hint: nil)
  super(field:, record: form.object, repository:)
  @form = form
  @label = label
  @hint = hint
end

Instance Attribute Details

#formObject (readonly)

Returns the value of attribute form.



28
29
30
# File 'app/components/uchi/field/base.rb', line 28

def form
  @form
end

#hintObject (readonly)

Returns the value of attribute hint.



28
29
30
# File 'app/components/uchi/field/base.rb', line 28

def hint
  @hint
end

#labelObject (readonly)

Returns the value of attribute label.



28
29
30
# File 'app/components/uchi/field/base.rb', line 28

def label
  @label
end