module PaylocityWebService::Configuration
Constants
- DEFAULT_ACCESS_TOKEN
By default, don't set a user access token
- DEFAULT_ADAPTER
The adapter that will be used to connect if none is set
@note The default faraday adapter is Net::HTTP.
- DEFAULT_CLIENT_ID
By default, don't set an application ID
- DEFAULT_CLIENT_SECRET
By default, don't set an application secret
- DEFAULT_CONNECTION_OPTIONS
By default, don't set any connection options
- DEFAULT_ENDPOINT
The endpoint that will be used to connect if none is set
@note There is no reason to use any other endpoint at this time
- DEFAULT_FORMAT
The response format appended to the path and sent in the 'Accept' header if none is set
@note JSON is the only available format at this time
- DEFAULT_PROXY
By default, don't use a proxy server
- DEFAULT_SSL_VERIFY_MODE
By default, the ssl_verify_mode is true
- DEFAULT_USER_AGENT
The user agent that will be sent to the API endpoint if none is set
- VALID_OPTIONS_KEYS
Public Class Methods
Sets all configuration options to their default values when this module is extended.
# File lib/paylocity_web_service/configuration.rb, line 56 def self.extended(base) base.reset end
Public Instance Methods
Set configuration options using a block
# File lib/paylocity_web_service/configuration.rb, line 61 def configure yield self end
Creates a hash of options and their values.
# File lib/paylocity_web_service/configuration.rb, line 66 def options VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end
Reset configuration options to default values
# File lib/paylocity_web_service/configuration.rb, line 73 def reset self.client_id = DEFAULT_CLIENT_ID self.client_secret = DEFAULT_CLIENT_SECRET self.connection_options = DEFAULT_CONNECTION_OPTIONS self.endpoint = DEFAULT_ENDPOINT self.format = DEFAULT_FORMAT self.proxy = DEFAULT_PROXY self.user_agent = DEFAULT_USER_AGENT self.ssl_verify_mode = DEFAULT_SSL_VERIFY_MODE self end