Class: Vzaar::Uploader
- Inherits:
-
Struct
- Object
- Struct
- Vzaar::Uploader
- Defined in:
- lib/vzaar/uploader.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
Returns the value of attribute conn.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#signature ⇒ Object
Returns the value of attribute signature.
Instance Method Summary collapse
Instance Attribute Details
#conn ⇒ Object
Returns the value of attribute conn
4 5 6 |
# File 'lib/vzaar/uploader.rb', line 4 def conn @conn end |
#opts ⇒ Object
Returns the value of attribute opts
4 5 6 |
# File 'lib/vzaar/uploader.rb', line 4 def opts @opts end |
#signature ⇒ Object
Returns the value of attribute signature
4 5 6 |
# File 'lib/vzaar/uploader.rb', line 4 def signature @signature end |
Instance Method Details
#processing_params ⇒ Object
21 22 23 |
# File 'lib/vzaar/uploader.rb', line 21 def processing_params opts.merge guid: guid end |
#upload ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/vzaar/uploader.rb', line 7 def upload if link_upload? link else result = s3.upload if result[:success] opts[:chunks] = result[:total_chunks] yield(self) if block_given? end end rescue Exception => e raise(Vzaar::Error, "Upload error: " + e.) end |