class Baha::ContainerOptions::Volumes

Public Class Methods

new(*args) click to toggle source
Calls superclass method Baha::ContainerOptions::Option::new
# File lib/baha/container_options/volumes.rb, line 5
def initialize(*args)
  super(:volumes,*args)
end

Public Instance Methods

apply(config) click to toggle source
# File lib/baha/container_options/volumes.rb, line 8
def apply(config)
  unless config.has_key?('Volumes')
    config['Volumes'] = {}
  end
  @value.each do |mount|
    config['Volumes'][mount] = {}
  end
end
validate!() click to toggle source
# File lib/baha/container_options/volumes.rb, line 16
def validate!
  raise ERROR("should be an array") unless @value.kind_of?(Array)
  @value.each_with_index do |item,index|
    raise ERROR("#{index}: '#{item}' should be a string") unless item.kind_of?(String)
  end
end