Class: Zencoder::HTTP::Typhoeus

Inherits:
Object
  • Object
show all
Defined in:
lib/zencoder/http/typhoeus.rb

Class Method Summary collapse

Class Method Details

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



17
18
19
# File 'lib/zencoder/http/typhoeus.rb', line 17

def self.delete(url, options={})
  perform(:delete, url, options)
end

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



13
14
15
# File 'lib/zencoder/http/typhoeus.rb', line 13

def self.get(url, options={})
  perform(:get, url, options)
end

.perform(method, url, options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/zencoder/http/typhoeus.rb', line 21

def self.perform(method, url, options={})
  options = options.dup
  if options.delete(:skip_ssl_verify)
    options[:disable_ssl_peer_verification] = true
  end

  if ca_file = options.delete(:ca_file)
    options[:sslcert] = ca_file
  end

  if ca_path = options.delete(:ca_path)
    options[:capath] = ca_path
  end

  ::Typhoeus::Request.send(method, url, options)
end

.post(url, options = {}) ⇒ Object



5
6
7
# File 'lib/zencoder/http/typhoeus.rb', line 5

def self.post(url, options={})
  perform(:post, url, options)
end

.put(url, options = {}) ⇒ Object



9
10
11
# File 'lib/zencoder/http/typhoeus.rb', line 9

def self.put(url, options={})
  perform(:put, url, options)
end