Class: Input::DatetimeComponent

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DatetimeComponent.



5
6
7
8
9
10
11
# File 'app/components/input/datetime_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/datetime_component.rb', line 13

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