Module: SuperExceptionNotifier::DeprecatedMethods

Included in:
ExceptionNotifiable::ClassMethods
Defined in:
lib/super_exception_notifier/deprecated_methods.rb

Constant Summary collapse

@@namespacing =
"Better namespacing to allow for Notifiable and ExceptionNotifiable to have similar APIs"
@@rails2ruby =
"An effort to make this a 'Ruby' Gem and not a stricly 'Rails' Gem"

Instance Method Summary collapse

Instance Method Details

#deprecation_warning(old, new, reason = "") ⇒ Object



56
57
58
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 56

def deprecation_warning(old, new, reason = "")
  puts "[DEPRECATION WARNING] ** Method '#{old}' has been replaced by '#{new}', please update your code.#{' Reason for change: ' + reason + '.' if reason}"
end

#exception_notifier_verboseObject

Now defined in Object class by init.rb & Notifiable module,

so we need to override them for with the controller settings


31
32
33
34
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 31

def exception_notifier_verbose
  deprecation_warning("exception_notifier_verbose", "exception_notifiable_verbose", @@namespacing)
  exception_notifiable_verbose
end

#exception_notifier_verbose=(arg) ⇒ Object



43
44
45
46
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 43

def exception_notifier_verbose=(arg)
  deprecation_warning("exception_notifier_verbose=", "exception_notifiable_verbose=", @@namespacing)
  exception_notifiable_verbose = arg
end

#http_error_codesObject



9
10
11
12
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 9

def http_error_codes
  deprecation_warning("http_error_codes", "error_class_status_codes")
  error_class_status_codes
end

#http_error_codes=(arg) ⇒ Object



14
15
16
17
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 14

def http_error_codes=(arg)
  deprecation_warning("http_error_codes", "error_class_status_codes")
  error_class_status_codes=(arg)
end

#notification_levelObject



39
40
41
42
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 39

def notification_level
  deprecation_warning("notification_level", "exception_notifiable_notification_level", @@namespacing)
  exception_notifiable_notification_level
end

#notification_level=(arg) ⇒ Object



51
52
53
54
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 51

def notification_level=(arg)
  deprecation_warning("notification_level=", "exception_notifiable_notification_level=", @@namespacing)
  exception_notifiable_notification_level = arg
end

#rails_error_codesObject



19
20
21
22
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 19

def rails_error_codes
  deprecation_warning("rails_error_codes", "error_class_status_codes", @@rails2ruby)
  error_class_status_codes
end

#rails_error_codes=(arg) ⇒ Object



24
25
26
27
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 24

def rails_error_codes=(arg)
  deprecation_warning("rails_error_codes=", "error_class_status_codes=", @@rails2ruby)
  error_class_status_codes=(arg)
end

#silent_exceptionsObject



35
36
37
38
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 35

def silent_exceptions
  deprecation_warning("silent_exceptions", "exception_notifiable_silent_exceptions", @@namespacing)
  exception_notifiable_silent_exceptions
end

#silent_exceptions=(arg) ⇒ Object



47
48
49
50
# File 'lib/super_exception_notifier/deprecated_methods.rb', line 47

def silent_exceptions=(arg)
  deprecation_warning("silent_exceptions=", "exception_notifiable_silent_exceptions=", @@namespacing)
  exception_notifiable_silent_exceptions = arg
end