module Eco module API class Session class Config class SFTP < BaseConfig attr_key :host, :user attr_key :password, :key_file attr_key :base_path, :enviro_subpaths def configured? required = host && user && (key_file || password) !!required end def enviro_subpath enviro_subpaths[config.active_enviro] end def remote_folder [base_path, enviro_subpath].compact.join("/") end end end end end end