Module: Backup::Configuration::Helpers::ClassMethods

Defined in:
lib/backup/configuration/helpers.rb

Instance Method Summary collapse

Instance Method Details

#clear_defaults!Object

Used only within the specs



28
29
30
# File 'lib/backup/configuration/helpers.rb', line 28

def clear_defaults!
  defaults.reset!
end

#defaultsObject

Returns or yields the Configuration::Store for storing pre-configured defaults for the class.



16
17
18
19
20
21
22
23
24
# File 'lib/backup/configuration/helpers.rb', line 16

def defaults
  @configuration ||= Configuration::Store.new

  if block_given?
    yield @configuration
  else
    @configuration
  end
end

#deprecationsObject



32
33
34
# File 'lib/backup/configuration/helpers.rb', line 32

def deprecations
  @deprecations ||= {}
end

#log_deprecation_warning(name, deprecation) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/backup/configuration/helpers.rb', line 36

def log_deprecation_warning(name, deprecation)
  msg = "#{ self }##{ name } has been deprecated as of " +
      "backup v.#{ deprecation[:version] }"
  msg << "\n#{ deprecation[:message] }" if deprecation[:message]
  Logger.warn Backup::Errors::ConfigurationError.new <<-EOS
    [DEPRECATION WARNING]
    #{ msg }
  EOS
end