class VpsbClient::Api::GetCurrentTrialRequest

Public Class Methods

new(http_client, params) click to toggle source
Calls superclass method
# File lib/vpsb_client/api/get_current_trial_request.rb, line 4
def initialize(http_client, params)
  super(http_client)
  @client_hostname = params.fetch(:client_hostname)
end
trial(http_response) click to toggle source
# File lib/vpsb_client/api/get_current_trial_request.rb, line 19
def self.trial(http_response)
  return nil if http_response.parsed_response.empty?
  http_response.parsed_response.first
end
trial_id(http_response) click to toggle source
# File lib/vpsb_client/api/get_current_trial_request.rb, line 24
def self.trial_id(http_response)
  t = trial(http_response)
  t ? t['id'] : nil
end

Public Instance Methods

query_params() click to toggle source
# File lib/vpsb_client/api/get_current_trial_request.rb, line 13
def query_params
  {
    client_hostname: @client_hostname
  }
end
url_path() click to toggle source
# File lib/vpsb_client/api/get_current_trial_request.rb, line 9
def url_path
  "/api/trials/current"
end