Module: LogWeasel::HoptoadNotifier

Defined in:
lib/log_weasel/hoptoad_notifier.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



17
18
19
20
21
22
# File 'lib/log_weasel/hoptoad_notifier.rb', line 17

def self.included(base)
  base.send :alias_method, :notify_without_transaction_id, :notify
  base.send :alias_method, :notify, :notify_with_transaction_id
  base.send :alias_method, :notify_or_ignore_without_transaction_id, :notify_or_ignore
  base.send :alias_method, :notify_or_ignore, :notify_or_ignore_with_transaction_id
end

Instance Method Details

#add_transaction_id(opts) ⇒ Object



12
13
14
15
# File 'lib/log_weasel/hoptoad_notifier.rb', line 12

def add_transaction_id(opts)
  opts[:parameters]                           ||= {}
  opts[:parameters]['log_weasel_id'] = LogWeasel::Transaction.id
end

#notify_or_ignore_with_transaction_id(exception, opts = {}) ⇒ Object



7
8
9
10
# File 'lib/log_weasel/hoptoad_notifier.rb', line 7

def notify_or_ignore_with_transaction_id(exception, opts = {})
  add_transaction_id(opts) if LogWeasel::Transaction.id
  notify_or_ignore_without_transaction_id exception, opts
end

#notify_with_transaction_id(exception, opts = {}) ⇒ Object



2
3
4
5
# File 'lib/log_weasel/hoptoad_notifier.rb', line 2

def notify_with_transaction_id(exception, opts = {})
  add_transaction_id(opts) if LogWeasel::Transaction.id
  notify_without_transaction_id exception, opts
end