about summary refs log tree commit diff
path: root/app/models/export.rb
blob: cd1a58eb6dd852c5c851cfb28d38884b509fbc96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true
require 'csv'

class Export
  attr_reader :accounts

  def initialize(accounts)
    @accounts = accounts
  end

  def to_csv
    CSV.generate do |csv|
      accounts.each do |account|
        csv << [(account.local? ? account.local_username_and_domain : account.acct)]
      end
    end
  end
end