Class: Koi::SummaryList::NumberComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- Koi::SummaryList::NumberComponent
show all
- Defined in:
- app/components/koi/summary_list/number_component.rb
Instance Method Summary
collapse
Methods inherited from Base
#attribute_name, #call, #inspect, #raw_value, #render?, #to_s
Constructor Details
#initialize(model, attribute, format: :admin) ⇒ NumberComponent
6
7
8
9
10
|
# File 'app/components/koi/summary_list/number_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/number_component.rb', line 12
def attribute_value
number_to_human(raw_value) if raw_value.present?
end
|
#default_description_attributes ⇒ Object
16
17
18
|
# File 'app/components/koi/summary_list/number_component.rb', line 16
def default_description_attributes
{ class: "number" }
end
|