Class: K8y::Kubeconfig::User

Inherits:
Object
  • Object
show all
Defined in:
lib/k8y/kubeconfig/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, auth_info:) ⇒ User

Returns a new instance of User.



18
19
20
21
# File 'lib/k8y/kubeconfig/user.rb', line 18

def initialize(name:, auth_info:)
  @name = name
  @auth_info = auth_info
end

Instance Attribute Details

#auth_infoObject (readonly)

Returns the value of attribute auth_info.



8
9
10
# File 'lib/k8y/kubeconfig/user.rb', line 8

def auth_info
  @auth_info
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/k8y/kubeconfig/user.rb', line 8

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/k8y/kubeconfig/user.rb', line 10

def self.from_hash(hash)
  user = hash.fetch("user")
  new(
    name: hash.fetch("name"),
    auth_info: AuthInfo.from_hash(user)
  )
end