Module: FirstGivingApi::Configuration

Included in:
FirstGivingApi
Defined in:
lib/first_giving_api/configuration.rb

Constant Summary collapse

VALID_CONNECTION_KEYS =
[:endpoint, :user_agent, :method].freeze
VALID_OPTIONS_KEYS =
[:api_key, :format].freeze
VALID_CONFIG_KEYS =
VALID_CONNECTION_KEYS + VALID_OPTIONS_KEYS
DEFAULT_ENDPOINT =
nil
DEFAULT_METHOD =
:get
DEFAULT_USER_AGENT =
"First Giving API Ruby Gem #{FirstGivingApi::VERSION}".freeze
DEFAULT_API_KEY =
nil
DEFAULT_FORMAT =
:json

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



16
17
18
# File 'lib/first_giving_api/configuration.rb', line 16

def self.extended(base)
  base.reset
end

Instance Method Details

#resetObject



20
21
22
23
24
25
26
27
# File 'lib/first_giving_api/configuration.rb', line 20

def reset
  self.endpoint   = DEFAULT_ENDPOINT
  self.method     = DEFAULT_METHOD
  self.user_agent = DEFAULT_USER_AGENT
 
  self.api_key    = DEFAULT_API_KEY
  self.format     = DEFAULT_FORMAT
end