Class: Kube::Cluster::Standard::ServiceAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/kube/cluster/standard/service_account.rb

Instance Method Summary collapse

Constructor Details

#initialize(name:, namespace: nil, &block) ⇒ ServiceAccount

Returns a new instance of ServiceAccount.



10
11
12
13
14
15
16
# File 'lib/kube/cluster/standard/service_account.rb', line 10

def initialize(name:, namespace: nil, &block)
  super() do
    .name = name
    .namespace = namespace if namespace
    instance_exec(&block) if block
  end
end

Instance Method Details

#nameObject



18
19
20
# File 'lib/kube/cluster/standard/service_account.rb', line 18

def name
  to_h.dig(:metadata, :name)
end

#namespaceObject



22
23
24
# File 'lib/kube/cluster/standard/service_account.rb', line 22

def namespace
  to_h.dig(:metadata, :namespace)
end