Class: AttrDeprecated::AirbrakeNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/notifiers/airbrake_notifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ AirbrakeNotifier

Returns a new instance of AirbrakeNotifier.



3
4
5
# File 'lib/notifiers/airbrake_notifier.rb', line 3

def initialize(target)
  @target = target
end

Instance Method Details

#notify_airbrake(attribute) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/notifiers/airbrake_notifier.rb', line 7

def notify_airbrake(attribute)
  if defined?(Airbrake)
    Airbrake.notify Exception.new
                      "WARNING: Called deprecated attribute for #{klass.name}: #{attrs.join(', ')}\n" +
                      backtrace.map { |trace| "\t#{trace}" }.join("\n")

  end
rescue
end