Class: VpsbClient::Metrics::Uploader

Inherits:
Object
  • Object
show all
Defined in:
lib/vpsb_client/metrics/uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(http_client, trial_id) ⇒ Uploader

Returns a new instance of Uploader.



4
5
6
7
# File 'lib/vpsb_client/metrics/uploader.rb', line 4

def initialize(http_client, trial_id)
  @http_client = http_client
  @trial_id = trial_id
end

Instance Method Details

#upload(metric) ⇒ Object



9
10
11
12
13
# File 'lib/vpsb_client/metrics/uploader.rb', line 9

def upload(metric)
  upload_request = Api::PostMetricRequest.new(@http_client, @trial_id, metric)
  http_response = Api::Response.new(upload_request.run)
  Api::PostMetricRequest.metric_id(http_response)
end