Retrospring/lib/use_case/data_export/theme.rb

28 lines
501 B
Ruby
Raw Normal View History

2022-12-07 23:20:45 -08:00
# frozen_string_literal: true
require "use_case/data_export/base"
module UseCase
module DataExport
class Theme < UseCase::DataExport::Base
def files
return {} unless user.theme
{
"theme.json" => json_file!(
theme: theme_data
)
}
end
def theme_data
{}.tap do |obj|
column_names(::Theme).each do |field|
obj[field] = user.theme[field]
end
end
end
end
end
end