Class: KubeDSL::Resource
- Inherits:
-
Object
- Object
- KubeDSL::Resource
- Defined in:
- lib/kube-dsl/resource.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
Instance Method Summary collapse
-
#initialize(contents) ⇒ Resource
constructor
A new instance of Resource.
- #serialize ⇒ Object
- #to_resource ⇒ Object
- #to_yaml ⇒ Object
Constructor Details
#initialize(contents) ⇒ Resource
Returns a new instance of Resource.
5 6 7 |
# File 'lib/kube-dsl/resource.rb', line 5 def initialize(contents) @contents = contents end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
3 4 5 |
# File 'lib/kube-dsl/resource.rb', line 3 def contents @contents end |
Instance Method Details
#serialize ⇒ Object
9 10 11 |
# File 'lib/kube-dsl/resource.rb', line 9 def serialize cleanup(contents) end |
#to_resource ⇒ Object
17 18 19 |
# File 'lib/kube-dsl/resource.rb', line 17 def to_resource self end |
#to_yaml ⇒ Object
13 14 15 |
# File 'lib/kube-dsl/resource.rb', line 13 def to_yaml YAML.dump(serialize) end |