Skip to content

A platform for community discussion. Free, open, simple.

311 B
Raw Blame
# frozen_string_literal: true

module JsonApiKit
  class DefaultSorts
    def initialize(changes)
      @changes = changes
      @orderings = {}
    end

    def for(resource) = orderings[resource.class] ||= History.new(resource:, changes:).ordering

    private

    attr_reader :changes, :orderings
  end
end