Module: Backup::Config::Helpers::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#clear_defaults!Object

Used only within the specs



25
26
27
# File 'lib/backup/config/helpers.rb', line 25

def clear_defaults!
  defaults.reset!
end

#defaultsObject



14
15
16
17
18
19
20
21
22
# File 'lib/backup/config/helpers.rb', line 14

def defaults
  @defaults ||= Config::Defaults.new

  if block_given?
    yield @defaults
  else
    @defaults
  end
end

#deprecationsObject



29
30
31
# File 'lib/backup/config/helpers.rb', line 29

def deprecations
  @deprecations ||= {}
end

#log_deprecation_warning(name, deprecation) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/backup/config/helpers.rb', line 33

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 Config::Error.new(<<-EOS)
    [DEPRECATION WARNING]
    #{ msg }
  EOS
end