Class: Parse::HttpClient
- Inherits:
-
Object
- Object
- Parse::HttpClient
- Defined in:
- lib/parse/http_client.rb
Direct Known Subclasses
Defined Under Namespace
Classes: TimeoutError
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
- #build_query(hash) ⇒ Object
-
#initialize(base_url = nil, headers = {}) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #request(method, uri, headers, options) ⇒ Object
Constructor Details
#initialize(base_url = nil, headers = {}) ⇒ HttpClient
Returns a new instance of HttpClient.
7 8 9 10 |
# File 'lib/parse/http_client.rb', line 7 def initialize(base_url=nil, headers = {}) @base_url = base_url @headers = headers end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/parse/http_client.rb', line 5 def base_url @base_url end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/parse/http_client.rb', line 5 def headers @headers end |
Instance Method Details
#build_query(hash) ⇒ Object
12 13 14 |
# File 'lib/parse/http_client.rb', line 12 def build_query(hash) hash.to_a.map{|k, v| "#{k}=#{v}"}.join('&') end |
#request(method, uri, headers, options) ⇒ Object
16 17 18 |
# File 'lib/parse/http_client.rb', line 16 def request(method, uri, headers, ) NotImplementedError.new("Subclass responsibility") end |