Class: Vzaar::Uploader

Inherits:
Struct
  • Object
show all
Defined in:
lib/vzaar/uploader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connObject

Returns the value of attribute conn

Returns:

  • (Object)

    the current value of conn



4
5
6
# File 'lib/vzaar/uploader.rb', line 4

def conn
  @conn
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



4
5
6
# File 'lib/vzaar/uploader.rb', line 4

def opts
  @opts
end

#signatureObject

Returns the value of attribute signature

Returns:

  • (Object)

    the current value of signature



4
5
6
# File 'lib/vzaar/uploader.rb', line 4

def signature
  @signature
end

Instance Method Details

#processing_paramsObject



20
21
22
# File 'lib/vzaar/uploader.rb', line 20

def processing_params
  opts.merge guid: guid
end

#uploadObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/vzaar/uploader.rb', line 7

def upload
  begin
    if link_upload?
      link
    else
      success = s3.upload
      yield(self) if block_given? && success
    end
  rescue Exception => e
    raise(Vzaar::Error, "Upload error: " + e.message)
  end
end