class Eco::API::UseCases::DefaultCases::EntriesToCsv < Eco::API::Common::Loaders::UseCase name "entries-to-csv" type :import attr_reader :session, :options def main(entries, session, options, usecase) @options = options @session = session entries.export(filename) end private def filename options.dig(:export, :file) || "entries.csv" end end