Class: Opentsdb::Faraday

Inherits:
Object
  • Object
show all
Defined in:
lib/opentsdb/faraday.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  @url = url
  @options = options
end

Instance Attribute Details

#urlObject (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.options.timeout = 5
    req.options.open_timeout = 5
  end
end