Module: BulkImports::FileTransfer

Extended by:
FileTransfer
Included in:
FileTransfer
Defined in:
app/models/bulk_imports/file_transfer.rb,
app/models/bulk_imports/file_transfer/base_config.rb,
app/models/bulk_imports/file_transfer/group_config.rb,
app/models/bulk_imports/file_transfer/project_config.rb

Defined Under Namespace

Classes: BaseConfig, GroupConfig, ProjectConfig

Constant Summary collapse

UnsupportedObjectType =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#config_for(portable) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'app/models/bulk_imports/file_transfer.rb', line 9

def config_for(portable)
  case portable
  when ::Project
    FileTransfer::ProjectConfig.new(portable)
  when ::Group
    FileTransfer::GroupConfig.new(portable)
  else
    raise(UnsupportedObjectType, "Unsupported object type: #{portable.class}")
  end
end