Class: KubeDSL::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/kube-dsl/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentsObject (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

#serializeObject



9
10
11
# File 'lib/kube-dsl/resource.rb', line 9

def serialize
  cleanup(contents)
end

#to_resourceObject



17
18
19
# File 'lib/kube-dsl/resource.rb', line 17

def to_resource
  self
end

#to_yamlObject



13
14
15
# File 'lib/kube-dsl/resource.rb', line 13

def to_yaml
  YAML.dump(serialize)
end