Class: Trustdock::Client
- Inherits:
-
Object
- Object
- Trustdock::Client
- Defined in:
- lib/trustdock/client.rb
Constant Summary collapse
- PRODUCTION_URL =
"https://api.trustdock.io"
- SANDBOX_URL =
"https://api.test.trustdock.io"
Instance Attribute Summary collapse
-
#last_response ⇒ Object
readonly
Returns the value of attribute last_response.
Instance Method Summary collapse
- #create_verification(options = {}) ⇒ Object
-
#initialize(api_token, sandbox: false) ⇒ Client
constructor
A new instance of Client.
- #update_comparing_data(verification_id, options) ⇒ Object
- #update_document(verification_id, plan_id, options) ⇒ Object
- #update_plan(verification_id, options) ⇒ Object
- #verification(id) ⇒ Object
Constructor Details
#initialize(api_token, sandbox: false) ⇒ Client
Returns a new instance of Client.
8 9 10 11 |
# File 'lib/trustdock/client.rb', line 8 def initialize(api_token, sandbox: false) @api_token = api_token @sandbox = sandbox end |
Instance Attribute Details
#last_response ⇒ Object (readonly)
Returns the value of attribute last_response.
6 7 8 |
# File 'lib/trustdock/client.rb', line 6 def last_response @last_response end |
Instance Method Details
#create_verification(options = {}) ⇒ Object
19 20 21 22 23 |
# File 'lib/trustdock/client.rb', line 19 def create_verification( = {}) @last_response = request(:post, "/v2/verifications", ) Response::Verification.new JSON.parse(@last_response.body, symbolize_names: true) end |
#update_comparing_data(verification_id, options) ⇒ Object
37 38 39 40 41 |
# File 'lib/trustdock/client.rb', line 37 def update_comparing_data(verification_id, ) @last_response = request(:put, "/v2/verifications/#{verification_id}/comparing_data", ) nil end |
#update_document(verification_id, plan_id, options) ⇒ Object
31 32 33 34 35 |
# File 'lib/trustdock/client.rb', line 31 def update_document(verification_id, plan_id, ) @last_response = request(:put, "/v2/verifications/#{verification_id}/plans/#{plan_id}/documents", ) nil end |
#update_plan(verification_id, options) ⇒ Object
25 26 27 28 29 |
# File 'lib/trustdock/client.rb', line 25 def update_plan(verification_id, ) @last_response = request(:put, "/v2/verifications/#{verification_id}/plans", ) nil end |
#verification(id) ⇒ Object
13 14 15 16 17 |
# File 'lib/trustdock/client.rb', line 13 def verification(id) @last_response = request(:get, "/v2/verifications/#{id}") Response::Verification.new JSON.parse(@last_response.body, symbolize_names: true) end |