Class: Opentsdb::Faraday
- Inherits:
-
Object
- Object
- Opentsdb::Faraday
- Defined in:
- lib/opentsdb/faraday.rb
Overview
:nodoc:
Constant Summary collapse
- DEFAULT_TIMEOUT =
5
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Faraday
constructor
A new instance of Faraday.
- #post(body) ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Faraday
Returns a new instance of Faraday.
8 9 10 11 |
# File 'lib/opentsdb/faraday.rb', line 8 def initialize(url, = {}) @url = url @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/opentsdb/faraday.rb', line 5 def @options end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/opentsdb/faraday.rb', line 5 def url @url end |
Instance Method Details
#post(body) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/opentsdb/faraday.rb', line 13 def post(body) connection.post do |req| req.headers = headers req.body = body req..timeout = [:timeout] || DEFAULT_TIMEOUT req..open_timeout = [:open_timeout] || DEFAULT_TIMEOUT end end |