Class: DsfrComponent::StepperComponent
- Defined in:
- app/components/dsfr_component/stepper_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title:, value:, max:, next_title: nil, classes: [], html_attributes: {}) ⇒ StepperComponent
constructor
A new instance of StepperComponent.
Constructor Details
#initialize(title:, value:, max:, next_title: nil, classes: [], html_attributes: {}) ⇒ StepperComponent
Returns a new instance of StepperComponent.
7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/dsfr_component/stepper_component.rb', line 7 def initialize(title:, value:, max:, next_title: nil, classes: [], html_attributes: {}) @title = title @value = value @max = max @next_title = next_title raise ArgumentError, "Les étapes doivent aller de 1 jusqu´à 8 au maximum" if @value < 1 || @value > @max || @max > 8 super(classes: classes, html_attributes: html_attributes) end |