module Dialog::Configuration

Constants

DEFAULT_API_ENDPOINT
DEFAULT_API_TOKEN
DEFAULT_USER_AGENT
VALID_OPTIONS_KEYS

Public Class Methods

extended(base) click to toggle source
# File lib/dialog-api/configuration.rb, line 13
def self.extended(base)
  base.reset!
end

Public Instance Methods

configure() { |self| ... } click to toggle source

Convenience method to allow configuration options to be set in a block

# File lib/dialog-api/configuration.rb, line 18
def configure
  yield self
end
options() click to toggle source
# File lib/dialog-api/configuration.rb, line 22
def options
  Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]
end
reset!() click to toggle source
# File lib/dialog-api/configuration.rb, line 26
def reset!
  self.api_endpoint = DEFAULT_API_ENDPOINT
  self.api_token    = DEFAULT_API_TOKEN
  self.user_agent   = DEFAULT_USER_AGENT
  self.on_error     = Proc.new {}
  self.bot_id       = nil
  self.debug        = false

  return true
end