Class: DatatrueClient::Bridge
- Inherits:
-
Object
- Object
- DatatrueClient::Bridge
- Defined in:
- lib/datatrue_client/bridge.rb
Overview
Abstracts HTTP details of DataTrueClient commands, all methods are synchronous
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
Instance Method Summary collapse
-
#create_test_run(payload) ⇒ Hash
Creates and queues a DataTrue test run.
-
#initialize(options = {}) ⇒ Bridge
constructor
A new instance of Bridge.
-
#test_run_progress(job_id) ⇒ Hash
Queries test run progress.
Constructor Details
#initialize(options = {}) ⇒ Bridge
Returns a new instance of Bridge.
11 12 13 14 15 |
# File 'lib/datatrue_client/bridge.rb', line 11 def initialize(={}) @host = [:host] || 'datatrue.com' @scheme = [:scheme] || 'https' @api_key = [:api_key] end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
9 10 11 |
# File 'lib/datatrue_client/bridge.rb', line 9 def host @host end |
#scheme ⇒ Object
Returns the value of attribute scheme.
9 10 11 |
# File 'lib/datatrue_client/bridge.rb', line 9 def scheme @scheme end |
Instance Method Details
#create_test_run(payload) ⇒ Hash
Creates and queues a DataTrue test run
31 32 33 |
# File 'lib/datatrue_client/bridge.rb', line 31 def create_test_run(payload) post("test_runs", payload) end |
#test_run_progress(job_id) ⇒ Hash
Queries test run progress
70 71 72 |
# File 'lib/datatrue_client/bridge.rb', line 70 def test_run_progress(job_id) get("test_runs/progress/#{job_id}") end |