Class: JsonHttpConnection::Connection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- JsonHttpConnection::Connection
- Defined in:
- lib/json_http_connection/connection.rb
Overview
Permanent connection to a JSON HTTP Service using faraday and typhoeus
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
14 15 16 17 18 19 20 21 |
# File 'lib/json_http_connection/connection.rb', line 14 def initialize(config) @config = config @config[:headers] ||= {} @config[:headers].merge!('Content-Type' => 'application/json', 'Accept' => 'application/json') super(faraday_connection) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/json_http_connection/connection.rb', line 12 def config @config end |