Module: Transloadit::Response::Assembly

Defined in:
lib/transloadit/response/assembly.rb

Instance Method Summary collapse

Instance Method Details

#aborted?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/transloadit/response/assembly.rb', line 12

def aborted?
  self['ok'] == 'REQUEST_ABORTED'
end

#cancel!Object


8
9
10
# File 'lib/transloadit/response/assembly.rb', line 8

def cancel!
  self.replace Transloadit::Request.new(self['assembly_url']).delete
end

#canceled?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/transloadit/response/assembly.rb', line 16

def canceled?
  self['ok'] == 'ASSEMBLY_CANCELED'
end

#completed?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/transloadit/response/assembly.rb', line 20

def completed?
  self['ok'] == 'ASSEMBLY_COMPLETED'
end

#error?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'lib/transloadit/response/assembly.rb', line 24

def error?
  self['error'] != nil
end

#executing?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'lib/transloadit/response/assembly.rb', line 28

def executing?
  self['ok'] == 'ASSEMBLY_EXECUTING'
end

#finished?Boolean

Returns:

  • (Boolean)

32
33
34
# File 'lib/transloadit/response/assembly.rb', line 32

def finished?
  aborted? || canceled? || completed? || error?
end

#reload!Object


4
5
6
# File 'lib/transloadit/response/assembly.rb', line 4

def reload!
  self.replace Transloadit::Request.new(self['assembly_url']).get
end

#uploading?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/transloadit/response/assembly.rb', line 36

def uploading?
  self['ok'] == 'ASSEMBLY_UPLOADING'
end