Class: KubeDSL::SerializeHandler
- Inherits:
-
Object
- Object
- KubeDSL::SerializeHandler
- Defined in:
- lib/kube-dsl/serialize_handler.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #handle(res, inflector) ⇒ Object
-
#initialize(namespace, version, kind, field, &block) ⇒ SerializeHandler
constructor
A new instance of SerializeHandler.
- #matches?(ref, field) ⇒ Boolean
Constructor Details
#initialize(namespace, version, kind, field, &block) ⇒ SerializeHandler
Returns a new instance of SerializeHandler.
7 8 9 10 11 12 13 |
# File 'lib/kube-dsl/serialize_handler.rb', line 7 def initialize(namespace, version, kind, field, &block) @namespace = namespace @version = version @kind = kind @field = field @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
5 6 7 |
# File 'lib/kube-dsl/serialize_handler.rb', line 5 def block @block end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/kube-dsl/serialize_handler.rb', line 5 def field @field end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
5 6 7 |
# File 'lib/kube-dsl/serialize_handler.rb', line 5 def kind @kind end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
5 6 7 |
# File 'lib/kube-dsl/serialize_handler.rb', line 5 def namespace @namespace end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/kube-dsl/serialize_handler.rb', line 5 def version @version end |
Instance Method Details
#handle(res, inflector) ⇒ Object
22 23 24 |
# File 'lib/kube-dsl/serialize_handler.rb', line 22 def handle(res, inflector) block.call(res, inflector) end |
#matches?(ref, field) ⇒ Boolean
15 16 17 18 19 20 |
# File 'lib/kube-dsl/serialize_handler.rb', line 15 def matches?(ref, field) ref.namespace == namespace && ref.version == version && ref.kind == kind && field == self.field end |