Class: Kbt::Deployment

Inherits:
Object
  • Object
show all
Defined in:
lib/kbt/deployment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Deployment

Returns a new instance of Deployment.



4
5
6
7
8
9
10
# File 'lib/kbt/deployment.rb', line 4

def initialize(args = {})
  @template = args.fetch(:template)
  @name = args.fetch(:name)
  @labels = args.fetch(:labels)
  @containers = args.fetch(:containers)
  @replicas = args[:replicas] || 1
end

Instance Attribute Details

#containersObject (readonly)

Returns the value of attribute containers.



3
4
5
# File 'lib/kbt/deployment.rb', line 3

def containers
  @containers
end

#labelsObject (readonly)

Returns the value of attribute labels.



3
4
5
# File 'lib/kbt/deployment.rb', line 3

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/kbt/deployment.rb', line 3

def name
  @name
end

#replicasObject (readonly)

Returns the value of attribute replicas.



3
4
5
# File 'lib/kbt/deployment.rb', line 3

def replicas
  @replicas
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
# File 'lib/kbt/deployment.rb', line 12

def to_h
  Fusu::Hash.deep_merge(
    template.value,
    overrides
  )
end