cartodb/app/controllers/carto/api/template_presenter.rb
2020-06-15 10:58:47 +08:00

32 lines
1010 B
Ruby

module Carto
module Api
class TemplatePresenter
def initialize(template)
@template = template
end
# When used inside a list, parent will be a " items: [ ... ] "
def public_values
{
id: @template.id,
title: @template.title,
description: @template.description,
source_visualization: {
id: @template.source_visualization_id
},
min_supported_version: @template.min_supported_version,
max_supported_version: @template.max_supported_version,
code: @template.code,
organization: {
id: @template.organization_id
},
required_tables: @template.required_tables,
created_at: @template.created_at
}
end
end
end
end