lib/smartsheet/api/request_client.rb in smartsheet-1.0.0 vs lib/smartsheet/api/request_client.rb in smartsheet-1.1.0

- old
+ new

@@ -1,28 +1,44 @@ -require 'smartsheet/error' - -module Smartsheet - module API - # Composes {EndpointSpec endpoint specifications} and {RequestSpec request specifications} to - # form a single {Request} that it submits to the provided client - class RequestClient - def initialize(token, client, base_url, assume_user: nil, logger: MuteRequestLogger.new) - @token = token - @client = client - @assume_user = assume_user - @logger = logger - @base_url = base_url - end - - def make_request(endpoint_spec, request_spec) - request = Request.new(token, endpoint_spec, request_spec, base_url, assume_user: assume_user) - - logger.log_request(request) - client.make_request(request) - end - - private - - attr_reader :token, :client, :assume_user, :logger, :base_url - end - end +require 'smartsheet/version' +require 'smartsheet/error' + +module Smartsheet + module API + # Composes {EndpointSpec endpoint specifications} and {RequestSpec request specifications} to + # form a single {Request} that it submits to the provided client + class RequestClient + def initialize( + token, + client, + base_url, + app_user_agent: nil, + assume_user: nil, + logger: MuteRequestLogger.new + ) + @token = token + @client = client + @app_user_agent = app_user_agent + @assume_user = assume_user + @logger = logger + @base_url = base_url + end + + def make_request(endpoint_spec, request_spec) + request = Request.new( + token, + endpoint_spec, + request_spec, + base_url, + app_user_agent: app_user_agent, + assume_user: assume_user + ) + + logger.log_request(request) + client.make_request(request) + end + + private + + attr_reader :token, :client, :app_user_agent, :assume_user, :logger, :base_url + end + end end \ No newline at end of file