Sha256: 40a2afe3c6e9fd1de48a6c565ae084f93adf05ff7c779a23010eb508ec25f8f4

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

class Zencoder
  class Job < Zencoder

    def self.create(params={}, options={})
      params = apply_api_key(params, options[:format])
      HTTP.post("#{base_url}/jobs",
                           encode(params, options[:format]),
                           options)
    end

    def self.list(options={})
      params = {:api_key  => options.delete(:api_key) || api_key,
                :page     => options.delete(:page) || 1,
                :per_page => options.delete(:per_page) || 50 }

      HTTP.get("#{base_url}/jobs", merge_params(options, params))
    end

    def self.details(job_id, options={})
      params = {:api_key => options.delete(:api_key) || api_key}
      HTTP.get("#{base_url}/jobs/#{job_id}", merge_params(options, params))
    end

    def self.resubmit(job_id, options={})
      params = {:api_key => options.delete(:api_key) || api_key}
      HTTP.get("#{base_url}/jobs/#{job_id}/resubmit", merge_params(options, params))
    end

    def self.cancel(job_id, options={})
      params = {:api_key => options.delete(:api_key) || api_key}
      HTTP.get("#{base_url}/jobs/#{job_id}/cancel", merge_params(options, params))
    end

    def self.delete(job_id, options={})
      params = {:api_key => options.delete(:api_key) || api_key}
      HTTP.delete("#{base_url}/jobs/#{job_id}", merge_params(options, params))
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zencoder-2.1.10 lib/zencoder/job.rb
zencoder-2.1.9 lib/zencoder/job.rb