Class: ErrorappNotifier::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/errorapp_notifier/notifier.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, uniq_key = nil) ⇒ Notifier

Returns a new instance of Notifier.



6
7
8
9
# File 'lib/errorapp_notifier/notifier.rb', line 6

def initialize(data, uniq_key = nil)
  @uniq_key = uniq_key
  @data = data
end

Class Method Details

.notify_error(exception_data) ⇒ Object



11
12
13
14
15
16
# File 'lib/errorapp_notifier/notifier.rb', line 11

def self.notify_error(exception_data)
  new(
    exception_data.to_json,
    exception_data.uniq_key
  ).notify_error
end

Instance Method Details

#notify_errorObject



18
19
20
21
22
# File 'lib/errorapp_notifier/notifier.rb', line 18

def notify_error
  log_and_send do
    client.post(url, data)
  end
end