class VpsbClient::Api::GetTrialLastMetricRequest

Public Class Methods

new(http_client, params) click to toggle source
Calls superclass method
# File lib/vpsb_client/api/get_trial_last_metric_request.rb, line 4
def initialize(http_client, params)
  super(http_client)
  @trial_id = params[:trial_id]
  @length = params[:length]
end
started_at(http_response) click to toggle source
# File lib/vpsb_client/api/get_trial_last_metric_request.rb, line 18
def self.started_at(http_response)
  return nil if http_response.parsed_response.empty?
  metric = http_response.parsed_response.first
  DateTime.parse(metric['started_at']).to_time
end

Public Instance Methods

query_params() click to toggle source
# File lib/vpsb_client/api/get_trial_last_metric_request.rb, line 14
def query_params
  { length: @length  }
end
url_path() click to toggle source
# File lib/vpsb_client/api/get_trial_last_metric_request.rb, line 10
def url_path
  "/api/trials/#{@trial_id}/last_metric"
end