demarches-normaliennes/app/components/expandable_error_list.rb
2024-08-22 09:26:48 +02:00

11 lines
219 B
Ruby

# frozen_string_literal: true
class ExpandableErrorList < ApplicationComponent
def initialize(errors:)
@errors = errors
end
def splitted_errors
yield(Array(@errors[0..2]), Array(@errors[3..]))
end
end