demarches-normaliennes/app/models/sorted_column.rb

17 lines
268 B
Ruby
Raw Normal View History

2024-09-23 10:35:00 +02:00
# 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