Module: DockerCompose::Generator::Service::Volumes
- Included in:
- DockerCompose::Generator::Service
- Defined in:
- lib/docker-compose/generator/service/volumes.rb
Overview
Handles Volumes in the docker-compose file
Instance Method Summary collapse
- #add_volume(host, container = nil, mode = nil) ⇒ Object
- #drop_volume(host, container, mode = nil) ⇒ Object
- #volume?(host, container = nil, mode = nil) ⇒ Boolean
Instance Method Details
#add_volume(host, container = nil, mode = nil) ⇒ Object
6 7 8 |
# File 'lib/docker-compose/generator/service/volumes.rb', line 6 def add_volume(host, container = nil, mode = nil) add_to_array('volumes', volume_name(host, container, mode)) end |
#drop_volume(host, container, mode = nil) ⇒ Object
10 11 12 |
# File 'lib/docker-compose/generator/service/volumes.rb', line 10 def drop_volume(host, container, mode = nil) drop_from_array('volumes', volume_name(host, container, mode)) end |
#volume?(host, container = nil, mode = nil) ⇒ Boolean
14 15 16 17 |
# File 'lib/docker-compose/generator/service/volumes.rb', line 14 def volume?(host, container = nil, mode = nil) volumes = @attrs['volumes'] || [] volumes.include?(volume_name(host, container, mode)) end |