Class: Gitlab::Kubernetes::Kubeconfig::Entry::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/kubernetes/kubeconfig/entry/cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, url:, ca_pem: nil) ⇒ Cluster

Returns a new instance of Cluster.



10
11
12
13
14
# File 'lib/gitlab/kubernetes/kubeconfig/entry/cluster.rb', line 10

def initialize(name:, url:, ca_pem: nil)
  @name = name
  @url = url
  @ca_pem = ca_pem
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/gitlab/kubernetes/kubeconfig/entry/cluster.rb', line 8

def name
  @name
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
# File 'lib/gitlab/kubernetes/kubeconfig/entry/cluster.rb', line 16

def to_h
  {
    name: name,
    cluster: cluster
  }
end