Sha256: d9cae2578e29bb99bf680231395ad25da1297669e8c47759b3f197526539072b

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

class Zencoder
  class Job < Zencoder

    def self.create(params={}, options={})
      params = apply_api_key(params, options[:format])
      HTTP.post("#{options[:base_url] || 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("#{options[:base_url] || 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("#{options[:base_url] || 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("#{options[:base_url] || 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("#{options[:base_url] || 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("#{options[:base_url] || base_url}/jobs/#{job_id}", merge_params(options, params))
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zencoder-2.2.2 lib/zencoder/job.rb
zencoder-2.2.1 lib/zencoder/job.rb
zencoder-2.2.0 lib/zencoder/job.rb
zencoder-2.1.15 lib/zencoder/job.rb
zencoder-2.1.14 lib/zencoder/job.rb
zencoder-2.1.13 lib/zencoder/job.rb
zencoder-2.1.12 lib/zencoder/job.rb
zencoder-2.1.11 lib/zencoder/job.rb