Class: Koi::SummaryList::DateComponent
- Defined in:
- app/components/koi/summary_list/date_component.rb
Instance Method Summary collapse
- #attribute_value ⇒ Object
-
#initialize(model, attribute, format: :admin) ⇒ DateComponent
constructor
A new instance of DateComponent.
Methods inherited from Base
#attribute_name, #call, #inspect, #raw_value, #render?, #to_s
Constructor Details
#initialize(model, attribute, format: :admin) ⇒ DateComponent
Returns a new instance of DateComponent.
6 7 8 9 10 |
# File 'app/components/koi/summary_list/date_component.rb', line 6 def initialize(model, attribute, format: :admin, **) super(model, attribute, **) @format = format end |
Instance Method Details
#attribute_value ⇒ Object
12 13 14 |
# File 'app/components/koi/summary_list/date_component.rb', line 12 def attribute_value l(raw_value.to_date, format: @format) if raw_value.present? end |