module AudioConfirmations
  class AudioConfirmationsPresenter
    def present(audio_confirmations)
      AudioConfirmationsData.new(
        audio_confirmations: sort(audio_confirmations),
      )
    end

    private

    def sort(audio_confirmations)
      audio_confirmations.sort_by(&:appears_at)
    end

    class AudioConfirmationsData < Struct.new(
      :audio_confirmations,
      keyword_init: true)
    end
  end
end
