Module: Simplewoo::Configuration

Included in:
Simplewoo
Defined in:
lib/simplewoo/configuration.rb

Constant Summary collapse

VALID_OPTIONS_KEYS =

TODO try to remove redis

[
  :app_secret,
  :api_server_host,
  :api_endpoint,
  :trusted,
  :ssl,
  :email,
  :password,
  :api_token,
  :debug
]

Instance Method Summary collapse

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



19
20
21
# File 'lib/simplewoo/configuration.rb', line 19

def configure
  yield self
end

#optionsObject



23
24
25
# File 'lib/simplewoo/configuration.rb', line 23

def options
  VALID_OPTIONS_KEYS.inject({}){|o,k| o.merge!(k => send(k)) }
end

#reset!Object



27
28
29
30
31
32
# File 'lib/simplewoo/configuration.rb', line 27

def reset!
  VALID_OPTIONS_KEYS.each {|key| class_eval(%Q{key = nil}) }
  self.trusted = "false"
  self.ssl = true
  self.debug = false
end