Class: Uppy::S3Multipart::App::Router
- Inherits:
-
Roda
- Object
- Roda
- Uppy::S3Multipart::App::Router
- Defined in:
- lib/uppy/s3_multipart/app.rb
Instance Method Summary collapse
- #client_call(operation, **options) ⇒ Object
- #error!(message, status: 400) ⇒ Object
- #param!(name) ⇒ Object
Instance Method Details
#client_call(operation, **options) ⇒ Object
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/uppy/s3_multipart/app.rb', line 137 def client_call(operation, **) client = opts[:client] overrides = opts[:options][operation] || {} overrides = overrides.call(request) if overrides.respond_to?(:call) = .merge(overrides) client.send(operation, **) end |
#error!(message, status: 400) ⇒ Object
156 157 158 |
# File 'lib/uppy/s3_multipart/app.rb', line 156 def error!(, status: 400) request.halt status, { error: } end |
#param!(name) ⇒ Object
148 149 150 151 152 153 154 |
# File 'lib/uppy/s3_multipart/app.rb', line 148 def param!(name) value = request.params[name] error! "Missing \"#{name}\" parameter" if value.nil? value end |