Class: Kubec::Status::Pod::Item
- Inherits:
-
Hash
- Object
- Hash
- Kubec::Status::Pod::Item
- Defined in:
- lib/kubec/status/pod.rb
Overview
:nodoc:
Constant Summary collapse
- FIELDS =
i[name ready status restarts age].freeze
Instance Attribute Summary collapse
-
#containers ⇒ Object
readonly
Returns the value of attribute containers.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(data) ⇒ Item
15 16 17 18 19 20 21 22 23 |
# File 'lib/kubec/status/pod.rb', line 15 def initialize(data) @data = data = data.dig('metadata') @spec = data.dig('spec') @status = data.dig('status') @containers = data.dig('status', 'containerStatuses') FIELDS.each { |field| send("setup_#{field}") } end |
Instance Attribute Details
#containers ⇒ Object (readonly)
Returns the value of attribute containers.
13 14 15 |
# File 'lib/kubec/status/pod.rb', line 13 def containers @containers end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/kubec/status/pod.rb', line 13 def end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
13 14 15 |
# File 'lib/kubec/status/pod.rb', line 13 def spec @spec end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/kubec/status/pod.rb', line 13 def status @status end |