Class: BackupClient::Components::Ftp::Commands::CreateFolder
- Inherits:
-
Object
- Object
- BackupClient::Components::Ftp::Commands::CreateFolder
- Includes:
- Helpers::FtpHelper, Helpers::LogHelper
- Defined in:
- lib/backup_client/components/ftp/commands/create_folder.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ftp_client, destination_path) ⇒ CreateFolder
constructor
A new instance of CreateFolder.
Methods included from Helpers::FtpHelper
#ftp_chdir, #ftp_dir_exists?, #ftp_mkdir, #ftp_mkdir_p, #root_chdir, #to_unix_path, #upload_dir_ftp, #upload_file_ftp
Methods included from Helpers::LogHelper
Constructor Details
#initialize(ftp_client, destination_path) ⇒ CreateFolder
Returns a new instance of CreateFolder.
11 12 13 14 15 |
# File 'lib/backup_client/components/ftp/commands/create_folder.rb', line 11 def initialize(ftp_client, destination_path) @ftp_client = ftp_client @destination_path = destination_path @force_root = force_root end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/backup_client/components/ftp/commands/create_folder.rb', line 17 def call return if ftp_dir_exists?(ftp_client, destination_path) return if ftp_mkdir(destination_path) ftp_mkdir_p(destination_path) end |