Class: Kamal::Configuration::Volume

Inherits:
Object
  • Object
show all
Defined in:
lib/kamal/configuration/volume.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host_path:, container_path:, options: nil) ⇒ Volume

Returns a new instance of Volume.



5
6
7
8
9
# File 'lib/kamal/configuration/volume.rb', line 5

def initialize(host_path:, container_path:, options: nil)
  @host_path = host_path
  @container_path = container_path
  @options = options
end

Instance Attribute Details

#container_pathObject (readonly)

Returns the value of attribute container_path.



2
3
4
# File 'lib/kamal/configuration/volume.rb', line 2

def container_path
  @container_path
end

#host_pathObject (readonly)

Returns the value of attribute host_path.



2
3
4
# File 'lib/kamal/configuration/volume.rb', line 2

def host_path
  @host_path
end

#optionsObject (readonly)

Returns the value of attribute options.



2
3
4
# File 'lib/kamal/configuration/volume.rb', line 2

def options
  @options
end

Instance Method Details

#docker_argsObject



11
12
13
# File 'lib/kamal/configuration/volume.rb', line 11

def docker_args
  argumentize "--volume", docker_args_string
end

#docker_args_stringObject



15
16
17
18
19
# File 'lib/kamal/configuration/volume.rb', line 15

def docker_args_string
  volume_string = "#{host_path_for_docker_volume}:#{container_path}"
  volume_string += ":#{options}" if options.present?
  volume_string
end