cartodb/app/controllers/carto/api/legend_presenter.rb

25 lines
542 B
Ruby
Raw Normal View History

2020-06-15 10:58:47 +08:00
module Carto
module Api
class LegendPresenter
def initialize(legend)
@legend = legend
end
def to_hash
{
conf: @legend.conf,
created_at: @legend.created_at,
definition: @legend.definition,
id: @legend.id,
layer_id: @legend.layer_id,
post_html: @legend.post_html,
pre_html: @legend.pre_html,
title: @legend.title,
type: @legend.type,
updated_at: @legend.updated_at
}
end
end
end
end