lib/fulmar/domain/service/file_sync_service.rb in fulmar-2.2.3 vs lib/fulmar/domain/service/file_sync_service.rb in fulmar-2.2.4

- old
+ new

@@ -4,23 +4,22 @@ require 'fulmar/infrastructure/model/transfer/tar' module Fulmar # Creates the required transfer model from the configuration class FileSync - def self.get_model(config) + def self.get_class(config) case config[:type] when 'rsync_with_versions' - transfer_model = Fulmar::Infrastructure::Model::Transfer::RsyncWithVersions.new(config) + transfer_class = Fulmar::Infrastructure::Model::Transfer::RsyncWithVersions when 'rsync' - transfer_model = Fulmar::Infrastructure::Model::Transfer::Rsync.new(config) + transfer_class = Fulmar::Infrastructure::Model::Transfer::Rsync when 'tar' - transfer_model = Fulmar::Infrastructure::Model::Transfer::Tar.new(config) + transfer_class = Fulmar::Infrastructure::Model::Transfer::Tar else help = config[:type] == '' ? 'Add a "type: " field to your deployment yaml file. ' : '' - transfer_model = nil raise "Transfer type '#{config[:type]}' is not valid. #{help}Valid values are: rsync, rsync_with_versions." end - transfer_model + transfer_class end end end