Class: Kubernetes::Metadata
- Inherits:
-
Object
- Object
- Kubernetes::Metadata
- Defined in:
- lib/kubernetes/metadata.rb
Instance Attribute Summary collapse
-
#creation_timestamp ⇒ Object
readonly
Returns the value of attribute creation_timestamp.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resource_version ⇒ Object
readonly
Returns the value of attribute resource_version.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(data) ⇒ Metadata
constructor
A new instance of Metadata.
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_timestamp ⇒ Object (readonly)
Returns the value of attribute creation_timestamp.
5 6 7 |
# File 'lib/kubernetes/metadata.rb', line 5 def @creation_timestamp end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
5 6 7 |
# File 'lib/kubernetes/metadata.rb', line 5 def link @link end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/kubernetes/metadata.rb', line 5 def name @name end |
#resource_version ⇒ Object (readonly)
Returns the value of attribute resource_version.
5 6 7 |
# File 'lib/kubernetes/metadata.rb', line 5 def resource_version @resource_version end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
5 6 7 |
# File 'lib/kubernetes/metadata.rb', line 5 def uid @uid end |