Class: AdvisorsCommandClient::Connection
- Inherits:
-
Object
- Object
- AdvisorsCommandClient::Connection
- Defined in:
- lib/advisors_command_client/connection.rb
Defined Under Namespace
Classes: WsseAuth
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(username, api_key, url) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(username, api_key, url) ⇒ Connection
Returns a new instance of Connection.
11 12 13 14 15 |
# File 'lib/advisors_command_client/connection.rb', line 11 def initialize(username, api_key, url) @username = username @api_key = api_key @url = url end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/advisors_command_client/connection.rb', line 17 def build Faraday.new(@url) do |faraday| faraday.request :json faraday.use AdvisorsCommandClient::Connection::WsseAuth, @username, @api_key faraday.adapter :typhoeus faraday.response :json, content_type: /\bjson$/ end end |