Class: Zencoder::Resource

Inherits:
Object
  • Object
show all
Includes:
Serializer
Defined in:
lib/zencoder/resource.rb

Direct Known Subclasses

Account, Input, Job, Notification, Output, Report

Class Method Summary collapse

Methods included from Serializer

#decode, #encode, included

Class Method Details

.api_keyObject



6
7
8
# File 'lib/zencoder/resource.rb', line 6

def self.api_key
  Zencoder.api_key
end

.base_urlObject



10
11
12
# File 'lib/zencoder/resource.rb', line 10

def self.base_url
  Zencoder.base_url
end

.delete(path, options = {}) ⇒ Object



37
38
39
40
41
42
# File 'lib/zencoder/resource.rb', line 37

def self.delete(path, options={})
  options = options.dup
  url     = url_for(path)
  options = add_api_key_header(options)
  HTTP.delete(url, options)
end

.get(path, options = {}) ⇒ Object



30
31
32
33
34
35
# File 'lib/zencoder/resource.rb', line 30

def self.get(path, options={})
  options = options.dup
  url     = url_for(path, options)
  options = add_api_key_header(options)
  HTTP.get(url, options)
end

.post(path, params = {}, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/zencoder/resource.rb', line 14

def self.post(path, params={}, options={})
  options = options.dup
  url     = url_for(path, options)
  body    = encode(params)
  options = add_api_key_header(options)
  HTTP.post(url, body, options)
end

.put(path, params = {}, options = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/zencoder/resource.rb', line 22

def self.put(path, params={}, options={})
  options = options.dup
  url     = url_for(path, options)
  body    = encode(params)
  options = add_api_key_header(options)
  HTTP.put(url, body, options)
end