Class: Zencoder::HTTP
- Inherits:
-
Object
- Object
- Zencoder::HTTP
- Includes:
- Serializer
- Defined in:
- lib/zencoder/http.rb,
lib/zencoder/http/net_http.rb,
lib/zencoder/http/typhoeus.rb
Defined Under Namespace
Constant Summary collapse
- CA_CHAIN_PATH =
File.(File.join(File.dirname(__FILE__), "http", "resources", "zencoder_ca_chain.crt"))
Class Attribute Summary collapse
-
.default_options ⇒ Object
Returns the value of attribute default_options.
-
.http_backend ⇒ Object
Returns the value of attribute http_backend.
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#options ⇒ Object
Returns the value of attribute options.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .delete(url, options = {}) ⇒ Object
- .get(url, options = {}) ⇒ Object
- .post(url, body, options = {}) ⇒ Object
- .put(url, body, options = {}) ⇒ Object
Instance Method Summary collapse
- #default_options ⇒ Object
- #http_backend ⇒ Object
-
#initialize(method, url, options = {}) ⇒ HTTP
constructor
A new instance of HTTP.
- #perform_method ⇒ Object
Methods included from Serializer
Constructor Details
#initialize(method, url, options = {}) ⇒ HTTP
Returns a new instance of HTTP.
21 22 23 24 25 |
# File 'lib/zencoder/http.rb', line 21 def initialize(method, url, ={}) self.method = method self.url = url self. = end |
Class Attribute Details
.default_options ⇒ Object
Returns the value of attribute default_options.
11 12 13 |
# File 'lib/zencoder/http.rb', line 11 def @default_options end |
.http_backend ⇒ Object
Returns the value of attribute http_backend.
11 12 13 |
# File 'lib/zencoder/http.rb', line 11 def http_backend @http_backend end |
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method.
8 9 10 |
# File 'lib/zencoder/http.rb', line 8 def method @method end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/zencoder/http.rb', line 8 def @options end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/zencoder/http.rb', line 8 def url @url end |
Class Method Details
.delete(url, options = {}) ⇒ Object
39 40 41 |
# File 'lib/zencoder/http.rb', line 39 def self.delete(url, ={}) new(:delete, url, ).perform_method end |
.get(url, options = {}) ⇒ Object
35 36 37 |
# File 'lib/zencoder/http.rb', line 35 def self.get(url, ={}) new(:get, url, ).perform_method end |
.post(url, body, options = {}) ⇒ Object
27 28 29 |
# File 'lib/zencoder/http.rb', line 27 def self.post(url, body, ={}) new(:post, url, .merge(:body => body)).perform_method end |
.put(url, body, options = {}) ⇒ Object
31 32 33 |
# File 'lib/zencoder/http.rb', line 31 def self.put(url, body, ={}) new(:put, url, .merge(:body => body)).perform_method end |
Instance Method Details
#default_options ⇒ Object
74 75 76 |
# File 'lib/zencoder/http.rb', line 74 def self.class. end |
#http_backend ⇒ Object
70 71 72 |
# File 'lib/zencoder/http.rb', line 70 def http_backend self.class.http_backend end |