Method: Dao::Upload#initialize

Defined in:
lib/dao/upload.rb

#initialize(conducer, *args, &block) ⇒ Upload

Returns a new instance of Upload.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/dao/upload.rb', line 179

def initialize(conducer, *args, &block)
  @conducer   = conducer

  @options    = Map.options_for!(args)
  @key        = Dao.key_for(args)
  @hidden_key = Upload.hidden_key_for(@key)
  @name       = Upload.name_for(@hidden_key)

  @placeholder = Placeholder.new(@options[:placeholder])

  @path = nil
  @dirname, @basename = nil
  @value = nil
  @io = nil
  @tmpdir = nil

  url = @placeholder.url

  update(:file => @io, :cache => @value, :url => url)
end