cartodb-4.42/app/controllers/carto/api/snapshot_presenter.rb

20 lines
418 B
Ruby
Raw Permalink Normal View History

2024-04-06 13:25:13 +08:00
module Carto
module Api
class SnapshotPresenter
def initialize(snapshot)
@snapshot = snapshot
end
def to_hash
{
id: @snapshot.id,
created_at: @snapshot.created_at,
updated_at: @snapshot.updated_at,
state: @snapshot.state,
user: Carto::Api::UserPresenter.new(@snapshot.user).to_public_poro
}
end
end
end
end