Class: Phocoder::HTTP::NetHTTP
- Inherits:
-
Object
- Object
- Phocoder::HTTP::NetHTTP
- Defined in:
- lib/phocoder/http/net_http.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#options ⇒ Object
Returns the value of attribute options.
-
#params ⇒ Object
Returns the value of attribute params.
-
#skip_ssl_verify ⇒ Object
Returns the value of attribute skip_ssl_verify.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#uri ⇒ Object
writeonly
Sets the attribute uri.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .delete(url, options = {}) ⇒ Object
- .get(url, options = {}) ⇒ Object
- .post(url, options = {}) ⇒ Object
- .put(url, options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(method, url, options) ⇒ NetHTTP
constructor
A new instance of NetHTTP.
- #perform ⇒ Object
Constructor Details
#initialize(method, url, options) ⇒ NetHTTP
Returns a new instance of NetHTTP.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/phocoder/http/net_http.rb', line 24 def initialize(method, url, ) @method = method @url = url @body = .delete(:body) @params = .delete(:params) @headers = .delete(:headers) @timeout = .delete(:timeout) @skip_ssl_verify = .delete(:skip_ssl_verify) @options = end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def method @method end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def @options end |
#params ⇒ Object
Returns the value of attribute params.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def params @params end |
#skip_ssl_verify ⇒ Object
Returns the value of attribute skip_ssl_verify.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def skip_ssl_verify @skip_ssl_verify end |
#timeout ⇒ Object
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def timeout @timeout end |
#uri=(value) ⇒ Object
Sets the attribute uri
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def uri=(value) @uri = value end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/phocoder/http/net_http.rb', line 8 def url @url end |
Class Method Details
.delete(url, options = {}) ⇒ Object
47 48 49 |
# File 'lib/phocoder/http/net_http.rb', line 47 def self.delete(url, ={}) new(:delete, url, ).perform end |
.get(url, options = {}) ⇒ Object
43 44 45 |
# File 'lib/phocoder/http/net_http.rb', line 43 def self.get(url, ={}) new(:get, url, ).perform end |
.post(url, options = {}) ⇒ Object
35 36 37 |
# File 'lib/phocoder/http/net_http.rb', line 35 def self.post(url, ={}) new(:post, url, ).perform end |
.put(url, options = {}) ⇒ Object
39 40 41 |
# File 'lib/phocoder/http/net_http.rb', line 39 def self.put(url, ={}) new(:put, url, ).perform end |
Instance Method Details
#perform ⇒ Object
51 52 53 |
# File 'lib/phocoder/http/net_http.rb', line 51 def perform deliver(http, request) end |