demarches-normaliennes/app/models/sorted_column.rb
2024-10-08 22:47:37 +02:00

16 lines
268 B
Ruby

# frozen_string_literal: true
class SortedColumn
attr_reader :column
def initialize(column:, order:)
@column = column
@order = order
end
def ascending? = @order == 'asc'
def ==(other)
other&.column == column && other.order == order
end
end