class NgpVan::Configuration
Attributes
The API Endpoint url. Which endpoint you should use is determined by which VAN client with which you're working. @note See developers.ngpvan.com/van-api#van-endpoints @return [String]
The API Key acquired from NGP VAN. The API Key resembles the concatenation of a GUID, a | and a 0 or 1 (e.g., bc7b6578-5619-4e8f-92ab-829208e1a511|1).
The `api_key` setting is used for authenticating requests.
@return [String, nil]
The Application Name in the NGP VAN system. A short string that identifies your application (e.g., acmeCrmProduct)
The `application_name` setting is used for authenticating requests.
@return [String, nil]
The User-Agent sent to the API endpoint. This defaults to the gem name, suffixed with the current version number. @return [String]
Public Class Methods
# File lib/ngp_van/configuration.rb, line 36 def initialize setup end
Public Instance Methods
Inspect the configuration object, masking private values. @return [String]
# File lib/ngp_van/configuration.rb, line 54 def inspect inspected = super if NgpVan.configuration.api_key filter_value!(inspected, NgpVan.configuration.api_key) end if NgpVan.configuration.application_name filter_value!(inspected, NgpVan.configuration.application_name) end inspected end
Reset all configuration to default values. @return [NgpVan::Configuration]
# File lib/ngp_van/configuration.rb, line 42 def reset! @application_name = NgpVan::Default.application_name @api_key = NgpVan::Default.api_key @api_endpoint = NgpVan::Default.api_endpoint @user_agent = NgpVan::Default.user_agent self end
Private Instance Methods
# File lib/ngp_van/configuration.rb, line 70 def filter_value!(source, str) source.gsub!(str, '[FILTERED]') end