class RevereMobile::Configuration

Attributes

api_endpoint[RW]

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]

api_key[RW]

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]

password[RW]

The Revere Mobile Password

The `password` setting is used for authenticating requests.

@return [String, nil]

query_size[RW]

The query size sent to the API endpoint. This defaults to 10, and determines the number of records to return. @return [number]

session[RW]

The user session. This defaults to nil but is written to once the authentication request has been made.

@return [String]

shortcode_id[RW]

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]

user_agent[RW]

The User-Agent sent to the API endpoint. This defaults to the gem name, suffixed with the current version number. @return [String]

username[RW]

The Revere Mobile Username

The `username` setting is used for authenticating requests.

@return [String, nil]

Public Class Methods

new() click to toggle source
# File lib/revere_mobile/configuration.rb, line 65
def initialize
  setup
end

Public Instance Methods

inspect() click to toggle source

Inspect the configuration object, masking private values. @return [String]

Calls superclass method
# 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!() click to toggle source

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
Also aliased as: setup
setup()
Alias for: reset!

Private Instance Methods

filter_value!(source, str) click to toggle source
# File lib/revere_mobile/configuration.rb, line 103
def filter_value!(source, str)
  source.gsub!(str, '[FILTERED]')
end