require 'picsolve_docker_builder/composer/requirements/context' require 'picsolve_docker_builder/composer/requirements/postgres' module PicsolveDockerBuilder module Composer # Requirements are enviromental dependencies for containers module Requirements def self.new(name, config, context) fail 'Requirement need to have parameter type' \ unless config.key? 'type' object(config['type']).new(name, config, context) end def self.object(type) if type == 'postgres' Postgres else fail "Unknown requirement '#{type}'" end end end end end