Class: Dapp::Kube::Kubernetes::Client::Resource::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/kube/kubernetes/client/resource/base.rb

Direct Known Subclasses

Deployment, Event, Job, Pod, Replicaset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 7

def initialize(spec)
  @spec = spec
end

Instance Attribute Details

#specObject (readonly)

Returns the value of attribute spec.



5
6
7
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 5

def spec
  @spec
end

Instance Method Details

#annotationsObject



23
24
25
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 23

def annotations
  .fetch('annotations', {})
end

#metadataObject



11
12
13
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 11

def 
  spec.fetch('metadata', {})
end

#nameObject



15
16
17
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 15

def name
  ['name']
end

#statusObject



27
28
29
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 27

def status
  spec.fetch('status', {})
end

#uidObject



19
20
21
# File 'lib/dapp/kube/kubernetes/client/resource/base.rb', line 19

def uid
  ['uid']
end