module Kilt::Upload
Public Class Methods
do(type, file_reference)
click to toggle source
# File lib/kilt/upload.rb, line 9 def self.do(type, file_reference) uploader = begin strategy = Kilt.config.storage.strategy.to_s "Kilt::Upload::#{strategy.classify}".constantize rescue nil end uploader.upload(type, file_reference) if uploader end
method_missing(meth, *args, &blk)
click to toggle source
# File lib/kilt/upload.rb, line 20 def method_missing(meth, *args, &blk) self.do meth.to_s, args[0] end
uploadable_fields()
click to toggle source
# File lib/kilt/upload.rb, line 4 def self.uploadable_fields types = ['file', 'image'] + Kilt.config.uploadable_fields.to_s.split(',').map { |x| x.strip } types.group_by { |x| x }.map { |x| x[0] } end