MultistepProcessInterface

InfoGeneratePackages

The code snippet defines a Ruby class named `StepsComponent`, which inherits from `ApplicationComponent`. The purpose of this class is to generate an HTML representation of a multi-step process or workflow, typically used in a user interface for processes like registration, planning, purchasing, or other sequential actions. The class's `template` method generates an unordered list (`

    `) with a class of `steps`, containing list items (`
  • `) for each step in the process. Each step is represented as an item with a class of `step` and optionally a specific color class (e.g., `step-primary`) to indicate the step's status or category. The hardcoded steps in this code snippet are "Register", "Choose plan", "Purchase", and "Receive Product", with the first two steps styled with the `step-primary` class indicating probably a certain level of importance or completion state.

# frozen_string_literal: true

# Steps component can be either:
# steps-vertical or steps-horizontal
#
# Each individual step component can be modified by:
# color: step-primary, step-secondary, step-accent, step-info, step-success, step-warning, step-error
class StepsComponent < ApplicationComponent
  def template
    ul(class: "steps") do
      li(class: "step step-primary") { "Register" }
      li(class: "step step-primary") { "Choose plan" }
      li(class: "step") { "Purchase" }
      li(class: "step") { "Receive Product" }
    end
  end
end