Class: Asana::HttpClient::EnvironmentInfo Private

Inherits:
Object
  • Object
show all
Defined in:
lib/asana/http_client/environment_info.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Adds environment information to a Faraday request.

Constant Summary collapse

USER_AGENT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

The default user agent to use in all requests to the API.

"ruby-asana v#{Asana::VERSION}"

Instance Method Summary collapse

Constructor Details

#initialize(user_agent = nil) ⇒ EnvironmentInfo

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EnvironmentInfo.



13
14
15
16
17
18
# File 'lib/asana/http_client/environment_info.rb', line 13

def initialize(user_agent = nil)
  @user_agent = user_agent || USER_AGENT
  @openssl_version = OpenSSL::OPENSSL_VERSION
  @client_version = Asana::VERSION
  @os = os
end

Instance Method Details

#configure(builder) ⇒ Object

Augments a Faraday connection with information about the environment.



22
23
24
25
# File 'lib/asana/http_client/environment_info.rb', line 22

def configure(builder)
  builder.headers[:user_agent] = @user_agent
  builder.headers[:'X-Asana-Client-Lib'] = header
end