Class: Kubec::Status::Service::Item
- Inherits:
-
Hash
- Object
- Hash
- Kubec::Status::Service::Item
- Defined in:
- lib/kubec/status/service.rb
Overview
:nodoc:
Constant Summary collapse
- FIELDS =
i[name cluster_ip ports selector].freeze
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
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 |
# File 'lib/kubec/status/service.rb', line 15 def initialize(data) @data = data = data.dig('metadata') @spec = data.dig('spec') 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/service.rb', line 13 def end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
13 14 15 |
# File 'lib/kubec/status/service.rb', line 13 def spec @spec end |