Class: Opentsdb::Faraday
- Inherits:
-
Object
- Object
- Opentsdb::Faraday
- Defined in:
- lib/opentsdb/faraday.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#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.
7 8 9 10 |
# File 'lib/opentsdb/faraday.rb', line 7 def initialize(url, = {}) @url = url = end |
Instance Attribute Details
#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
12 13 14 15 16 17 18 19 |
# File 'lib/opentsdb/faraday.rb', line 12 def post(body) connection.post do |req| req.headers = headers req.body = body req..timeout = 5 req..open_timeout = 5 end end |