Class: Err::Opbeat

Inherits:
Service show all
Defined in:
lib/err/services/opbeat.rb

Class Method Summary collapse

Methods inherited from Service

enabled?, key

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/err/services/opbeat.rb', line 4

def available?
  defined?(::Opbeat)
end

.configure(&block) ⇒ Object



8
9
10
11
# File 'lib/err/services/opbeat.rb', line 8

def configure(&block)
  return unless enabled?
  opbeat.configure(&block)
end

.development_environments=(envs) ⇒ Object



13
14
15
# File 'lib/err/services/opbeat.rb', line 13

def development_environments=(envs)
  config.environments = [config.current_environment] - envs.map(&:to_s)
end

.ignore=(exception_names) ⇒ Object



17
18
19
# File 'lib/err/services/opbeat.rb', line 17

def ignore=(exception_names)
  config.excluded_exceptions = exception_names
end

.message(msg, params = {}) ⇒ Object



25
26
27
28
29
# File 'lib/err/services/opbeat.rb', line 25

def message(msg, params = {})
  msg = msg.dup
  msg << " (#{params_string(params)})" if params.any?
  opbeat.captureMessage(msg)
end

.notify(exception, params = {}) ⇒ Object



21
22
23
# File 'lib/err/services/opbeat.rb', line 21

def notify(exception, params = {})
  opbeat.captureException(exception)
end