Class: Input::DateComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/input/date_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(item:, field:, form:, disabled: false) ⇒ DateComponent

Returns a new instance of DateComponent.



5
6
7
8
9
10
11
# File 'app/components/input/date_component.rb', line 5

def initialize(item:, field:, form:, disabled: false)
  @item = item
  @field = field
  @form = form
  @label = label
  @disabled = disabled
end

Instance Method Details

#labelObject



13
14
15
# File 'app/components/input/date_component.rb', line 13

def label
  I18n.t("bo.#{@item.class.name.underscore}.attributes.#{@field}")
end