Class: Sunrise::FileUpload::Manager

Inherits:
Object
  • Object
show all
Extended by:
Callbacks
Defined in:
lib/sunrise/file_upload/manager.rb

Instance Method Summary collapse

Methods included from Callbacks

_after_create, _before_create, after_create, before_create

Constructor Details

#initialize(app, options = {}) ⇒ Manager

Returns a new instance of Manager.



6
7
8
9
# File 'lib/sunrise/file_upload/manager.rb', line 6

def initialize(app, options = {})
  @app = app
  @paths = [options[:paths]].flatten
end

Instance Method Details

#_run_callbacks(*args) ⇒ Object

:api: private



16
17
18
# File 'lib/sunrise/file_upload/manager.rb', line 16

def _run_callbacks(*args) #:nodoc:
  self.class._run_callbacks(*args)
end

#call(env) ⇒ Object



11
12
13
# File 'lib/sunrise/file_upload/manager.rb', line 11

def call(env)
  raw_file_post?(env) ? create(env) : @app.call(env)
end