Class: ClusterSerializer

Inherits:
BaseSerializer show all
Includes:
WithPagination
Defined in:
app/serializers/cluster_serializer.rb

Instance Attribute Summary

Attributes included from WithPagination

#paginator

Attributes inherited from BaseSerializer

#params

Instance Method Summary collapse

Methods included from WithPagination

#paginated?, #represent, #with_pagination

Methods inherited from BaseSerializer

entity, #initialize, #represent

Constructor Details

This class inherits a constructor from BaseSerializer

Instance Method Details

#represent_list(resource) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/serializers/cluster_serializer.rb', line 7

def represent_list(resource)
  represent(resource, {
    only: [
      :cluster_type,
      :enabled,
      :environment_scope,
      :gitlab_managed_apps_logs_path,
      :enable_advanced_logs_querying,
      :kubernetes_errors,
      :name,
      :nodes,
      :path,
      :provider_type,
      :status
    ]
  })
end

#represent_status(resource) ⇒ Object


25
26
27
# File 'app/serializers/cluster_serializer.rb', line 25

def represent_status(resource)
  represent(resource, { only: [:status, :status_reason, :applications] })
end