module Bob::Configuration

Constants

VALID_OPTIONS_KEYS

Public Class Methods

extended(base) click to toggle source

Sets all configuration options to their default values when this module is extended.

# File lib/bob/configuration.rb, line 10
def self.extended(base)
  base.reset
end

Public Instance Methods

config() click to toggle source
# File lib/bob/configuration.rb, line 18
def config
  VALID_OPTIONS_KEYS.inject({}) do |option, key|
    option.merge!(key => send(key))
  end
end
configure() { |self| ... } click to toggle source
# File lib/bob/configuration.rb, line 14
def configure
  yield self
end
reset() click to toggle source

Resets all configuration options to the defaults.

# File lib/bob/configuration.rb, line 25
def reset
  self.api_version = 'v1'
  self.access_token = ENV['ACCESS_TOKEN']
  self.access_user_name = ENV['ACCESS_USER_NAME']
  self.api_key = ENV['API_KEY']
end