Method: CORL::Plugin::Network#attach_files

Defined in:
lib/core/plugin/network.rb

#attach_files(type, name, files, options = {}) ⇒ Object




267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/core/plugin/network.rb', line 267

def attach_files(type, name, files, options = {})
  attach_config  = Config.ensure(options).import({ :type => :file })
  included_files = []    
  files          = [ files ] unless files.is_a?(Array)
  
  files.each do |file|
    if file
      attached_file = config.attach(type, name, file, attach_config)
      included_files << attached_file unless attached_file.nil?
    end  
  end    
  included_files
end