class VpsbClient::Api::CreateTrialRequest
Constants
- MANDATORY_PARAM_NAMES
Public Class Methods
new(http_client, trial)
click to toggle source
Calls superclass method
# File lib/vpsb_client/api/create_trial_request.rb, line 6 def initialize(http_client, trial) super(http_client) @trial = trial MANDATORY_PARAM_NAMES.each do |name| raise ArgumentError, "param #{name} is mandatory" unless @trial.keys.include?(name) end @trial.keys.each do |name| raise ArgumentError, "param #{name} is not allowed" unless MANDATORY_PARAM_NAMES.include?(name) end end
trial(http_response)
click to toggle source
# File lib/vpsb_client/api/create_trial_request.rb, line 29 def self.trial(http_response) http_response.parsed_response end
trial_id(http_response)
click to toggle source
# File lib/vpsb_client/api/create_trial_request.rb, line 33 def self.trial_id(http_response) trial(http_response)['id'] end
Public Instance Methods
content_type()
click to toggle source
# File lib/vpsb_client/api/create_trial_request.rb, line 25 def content_type 'application/json' end
post_params()
click to toggle source
# File lib/vpsb_client/api/create_trial_request.rb, line 21 def post_params @post_params = { trial: @trial } end
url_path()
click to toggle source
# File lib/vpsb_client/api/create_trial_request.rb, line 17 def url_path "/api/trials" end