Class: Kubernetes::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/kubernetes/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Metadata

Returns a new instance of Metadata.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/kubernetes/metadata.rb', line 7

def initialize(data)
  @name = data.fetch("name", nil)
  @namespace = data.fetch("namespace", nil)
  @link = data.fetch("selfLink", nil)
  @uid = data.fetch("uid", nil)
  @resource_version = data.fetch("resourceVersion", nil)
  @creation_timestamp = data.fetch("creationTimestamp") && Time.iso8601(data.fetch("creationTimestamp"))
  @generate_name = data.fetch("generateName", nil)
  @labels = data.fetch("labels", {})
  @annotations = data.fetch("annotations", {})
end

Instance Attribute Details

#creation_timestampObject (readonly)

Returns the value of attribute creation_timestamp.



5
6
7
# File 'lib/kubernetes/metadata.rb', line 5

def creation_timestamp
  @creation_timestamp
end

Returns the value of attribute link.



5
6
7
# File 'lib/kubernetes/metadata.rb', line 5

def link
  @link
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/kubernetes/metadata.rb', line 5

def name
  @name
end

#resource_versionObject (readonly)

Returns the value of attribute resource_version.



5
6
7
# File 'lib/kubernetes/metadata.rb', line 5

def resource_version
  @resource_version
end

#uidObject (readonly)

Returns the value of attribute uid.



5
6
7
# File 'lib/kubernetes/metadata.rb', line 5

def uid
  @uid
end