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/latest"
- PROD_URL =
"https://advisorscommand.com/api/rest/latest"
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.
18 19 20 21 22 23 24 25 |
# File 'lib/advisors_command_client.rb', line 18 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.
16 17 18 |
# File 'lib/advisors_command_client.rb', line 16 def connection @connection end |
Instance Method Details
#contacts ⇒ Object
27 28 29 |
# File 'lib/advisors_command_client.rb', line 27 def contacts @contacts ||= Models::ContactCollection.new(connection: @connection) end |