Module: Nadir

Extended by:
Nadir
Included in:
Nadir
Defined in:
lib/nadir.rb,
lib/nadir/cli.rb,
lib/nadir/config.rb,
lib/nadir/version.rb,
lib/nadir/notification.rb,
lib/nadir/plugins/rails.rb,
lib/nadir/middleware/rack.rb,
lib/nadir/plugins/sidekiq.rb,
lib/nadir/transport/http_async.rb

Defined Under Namespace

Modules: Middleware, Transport Classes: CLI, Config, NadirTestException, Notification, Railtie, Sidekiq

Constant Summary collapse

VERSION =
'1.1.9'

Instance Method Summary collapse

Instance Method Details

#configObject



10
11
12
# File 'lib/nadir.rb', line 10

def config
  @config ||= Config.new
end

#configure {|config| ... } ⇒ Object

Yields:



14
15
16
# File 'lib/nadir.rb', line 14

def configure
  yield config if block_given?
end

#loggerObject



18
19
20
# File 'lib/nadir.rb', line 18

def logger
  config.logger
end

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



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/nadir.rb', line 22

def notify(exception, params = {})
  return false unless config.validate

  notification = Notification.new exception, params

  transport.deliver notification.to_params

  true
rescue => e
  logger.error "[Nadir] Internal error: #{e.inspect}"

  false
end