Class: ActiveEncode::EngineAdapters::ShingoncoderAdapter

Inherits:
ZencoderAdapter show all
Defined in:
lib/active_encode/engine_adapters/shingoncoder_adapter.rb

Instance Method Summary collapse

Methods inherited from ZencoderAdapter

#list, #purge, #remove_output

Instance Method Details

#cancel(encode) ⇒ Object

Parameters:


21
22
23
24
# File 'lib/active_encode/engine_adapters/shingoncoder_adapter.rb', line 21

def cancel(encode)
  response = Shingoncoder::Job.cancel(encode.id)
  build_encode(job_details(encode.id), encode.class) if response.success?
end

#create(encode) ⇒ Object

Parameters:


8
9
10
11
# File 'lib/active_encode/engine_adapters/shingoncoder_adapter.rb', line 8

def create(encode)
  response = Shingoncoder::Job.create(input: encode.input)
  build_encode(job_details(response.body["id"]), encode.class)
end

#find(id, opts = {}) ⇒ Object

Parameters:

  • id (Fixnum)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :cast (Object)

    the class to cast the encoding job to.


16
17
18
# File 'lib/active_encode/engine_adapters/shingoncoder_adapter.rb', line 16

def find(id, opts = {})
  build_encode(job_details(id), opts[:cast])
end