class RevereMobile::Configuration
Attributes
The API Endpoint url. Which endpoint you should use is determined by which version with which you're working. Some features may be require to use multiple versions of the endpoint and thus you may want to change this configuration. @note See mobile-developers.reverehq.com @return [String]
The Revere Mobile Shortcode Session
The `shortcode_id` setting is used for changing the shortcode session. Most accounts will have access to only one of these.
@return [String, nil]
The Revere Mobile Password
The `password` setting is used for authenticating requests.
@return [String, nil]
The query size sent to the API endpoint. This defaults to 10, and determines the number of records to return. @return [number]
The user session. This defaults to nil but is written to once the authentication request has been made.
@return [String]
The Revere Mobile API KEY
The `api_key` setting is used for authenticating requests. This approach does not require an active session ID. This method is more appropriate for integrations that always use the same credentials and do not want to add the complexity of session logic.
@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]
The Revere Mobile Username
The `username` setting is used for authenticating requests.
@return [String, nil]
Public Class Methods
# File lib/revere_mobile/configuration.rb, line 65 def initialize setup end
Public Instance Methods
Inspect the configuration object, masking private values. @return [String]
# File lib/revere_mobile/configuration.rb, line 87 def inspect inspected = super if RevereMobile.configuration.password filter_value!(inspected, RevereMobile.configuration.password) end if RevereMobile.configuration.api_key filter_value!(inspected, RevereMobile.configuration.api_key) end inspected end
Reset all configuration to default values. @return [RevereMobile::Configuration]
# File lib/revere_mobile/configuration.rb, line 71 def reset! @username = RevereMobile::Default.username @password = RevereMobile::Default.password @shortcode_id = RevereMobile::Default.shortcode_id @api_endpoint = RevereMobile::Default.api_endpoint @api_key = RevereMobile::Default.api_key @user_agent = RevereMobile::Default.user_agent @query_size = RevereMobile::Default.query_size @session = HTTP::CookieJar.new self end
Private Instance Methods
# File lib/revere_mobile/configuration.rb, line 103 def filter_value!(source, str) source.gsub!(str, '[FILTERED]') end