Class: DsfrComponent::StepperComponent
- Includes:
- Traits::HeaderSizeable
- Defined in:
- app/components/dsfr_component/stepper_component.rb
Constant Summary
Constants included from Traits::HeaderSizeable
Traits::HeaderSizeable::DEFAULT_HEADER_LEVEL
Constants inherited from Base
Base::HEADING_LEVELS, Base::SIZES
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title:, value:, max:, next_title: nil, header_level: 2, html_attributes: {}) ⇒ StepperComponent
constructor
A new instance of StepperComponent.
Methods included from Traits::HeaderSizeable
#default_header_level, #header_level, #header_level=, #header_tag
Constructor Details
#initialize(title:, value:, max:, next_title: nil, header_level: 2, html_attributes: {}) ⇒ StepperComponent
Returns a new instance of StepperComponent.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/dsfr_component/stepper_component.rb', line 10 def initialize(title:, value:, max:, next_title: nil, header_level: 2, html_attributes: {}) @title = title @value = value @max = max @next_title = next_title self.header_level = header_level raise ArgumentError, "Les étapes doivent aller de 1 jusqu´à 8 au maximum" if @value < 1 || @value > @max || @max > 8 super(html_attributes: html_attributes) end |