Module: SexySettings

Defined in:
lib/sexy_settings/core.rb,
lib/sexy_settings/base.rb,
lib/sexy_settings/version.rb,
lib/sexy_settings/printable.rb,
lib/sexy_settings/exceptions.rb,
lib/sexy_settings/configuration.rb,
lib/sexy_settings/sensitive_data_protector.rb

Overview

This module holds all custom sexy_settings exceptions

Defined Under Namespace

Modules: Printable Classes: Base, Configuration, SensitiveDataProtector

Constant Summary collapse

VERSION =
'0.1.0'.freeze
MissingDefaultError =

:nodoc:

Class.new(StandardError)

Class Method Summary collapse

Class Method Details

.configurationObject

Returns the global configuration object



10
11
12
# File 'lib/sexy_settings/core.rb', line 10

def self.configuration
  @configuration ||= SexySettings::Configuration.new
end

.configureObject

Yields the global configuration object

Examples

SexySettings.configure do |config|

config.env_variable_with_options = 'OPTIONS'

end



21
22
23
24
25
26
27
# File 'lib/sexy_settings/core.rb', line 21

def self.configure
  if block_given?
    yield configuration
  else
    configuration
  end
end

.resetObject

Used internally to ensure examples get reloaded between multiple runs in the same process.



5
6
7
# File 'lib/sexy_settings/core.rb', line 5

def self.reset
  configuration.class::DEFAULT_OPTIONS.keys.each { |key| configuration.send("#{key}=", nil) }
end