Module: Bomberman::Configuration

Included in:
Bomberman
Defined in:
lib/bomberman/configuration.rb

Constant Summary collapse

VALID_OPTIONS =
[:api_key, :api_version, :include_string_utils, :url].freeze
DEFAULT_VALUES =
{
    api_key: 'change me',
    api_version: 1,
    use_https: true,
    include_string_utils: false,
    url: 'bomberman.ikayzo.com'
    
    # Uncomment the following line if you are using the Bomberman Heroku addon
    # url: 'bomberman-prod.herokuapp.com'
}.freeze

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
# File 'lib/bomberman/configuration.rb', line 19

def configure
  reset
  yield self
  self
end

#resetObject Also known as: setup



25
26
27
28
29
30
# File 'lib/bomberman/configuration.rb', line 25

def reset
  VALID_OPTIONS.each do |key|
    instance_variable_set(:"@#{key}", DEFAULT_VALUES[key])
  end
  self
end