Welcome to mirror list, hosted at ThFree Co, Russian Federation.

show_ml_model_component.rb « ml « projects « components « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2fe2c7e7e9dd884ca5d788bbb0feb385c8e0321e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Projects
  module Ml
    class ShowMlModelComponent < ViewComponent::Base
      attr_reader :model

      def initialize(model:)
        @model = model.present
      end

      private

      def view_model
        vm = {
          model: {
            id: model.id,
            name: model.name,
            path: model.path
          }
        }

        Gitlab::Json.generate(vm)
      end
    end
  end
end