Class: AdvisorsCommandClient::Client
- Inherits:
-
Object
- Object
- AdvisorsCommandClient::Client
- Defined in:
- lib/advisors_command_client.rb
Constant Summary collapse
- TEST_URL =
"https://qa.advisorscommand.com/api/rest/v1"- PROD_URL =
"https://www.advisorscommand.com/api/rest/v1"
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #contacts ⇒ Object
-
#initialize(username, api_key, options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(username, api_key, options = {}) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 |
# File 'lib/advisors_command_client.rb', line 17 def initialize(username, api_key, = {}) if [:live] url = PROD_URL else url = TEST_URL end @connection = AdvisorsCommandClient::Connection.new(username, api_key, url).build end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
15 16 17 |
# File 'lib/advisors_command_client.rb', line 15 def connection @connection end |
Instance Method Details
#contacts ⇒ Object
26 27 28 |
# File 'lib/advisors_command_client.rb', line 26 def contacts @contacts ||= Models::ContactCollection.new(connection: @connection) end |