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

Inherits:
ViewComponent::Base
  • 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

Instance Method Summary collapse

Constructor Details

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



10
11
12
13
14
15
16
17
18
19
# File 'app/components/uchi/field/base.rb', line 10

def initialize(field:, form:, repository:, label: nil, hint: nil)
  super()

  @field = field
  @form = form
  @label = label
  @hint = hint
  @record = form.object
  @repository = repository
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def field
  @field
end

#formObject (readonly)

Returns the value of attribute form.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def form
  @form
end

#hintObject (readonly)

Returns the value of attribute hint.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def hint
  @hint
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def label
  @label
end

#recordObject (readonly)

Returns the value of attribute record.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def record
  @record
end

#repositoryObject (readonly)

Returns the value of attribute repository.



8
9
10
# File 'app/components/uchi/field/base.rb', line 8

def repository
  @repository
end