Class: Kubec::Status::Deployment::Item
- Inherits:
-
Hash
- Object
- Hash
- Kubec::Status::Deployment::Item
- Defined in:
- lib/kubec/status/deployment.rb
Overview
:nodoc:
Constant Summary collapse
- FIELDS =
i[name desire current up_to_date available age].freeze
Instance Attribute Summary collapse
-
#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
Returns a new instance of Item.
15 16 17 18 19 20 21 22 |
# File 'lib/kubec/status/deployment.rb', line 15 def initialize(data) @data = data = data.dig('metadata') @spec = data.dig('spec') @status = data.dig('status') FIELDS.each { |field| send("setup_#{field}") } end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/kubec/status/deployment.rb', line 13 def end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
13 14 15 |
# File 'lib/kubec/status/deployment.rb', line 13 def spec @spec end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/kubec/status/deployment.rb', line 13 def status @status end |