Module: ExceptionGateway
- Defined in:
- lib/exception_gateway.rb,
lib/exception_gateway/version.rb,
lib/exception_gateway/vendors/bugsnag.rb
Defined Under Namespace
Modules: Vendors
Classes: Config, Gateway
Constant Summary
collapse
- VERSION =
"0.2.1"
Class Method Summary
collapse
Class Method Details
.alert(msg, options = {}) ⇒ Object
20
21
22
23
|
# File 'lib/exception_gateway.rb', line 20
def self.alert(msg, options={})
method = "#{@@config.backend}_alert".to_s
@@gateway.send method, msg, options
end
|
13
14
15
16
17
18
|
# File 'lib/exception_gateway.rb', line 13
def self.configure
c = Config.new
yield c
@@config = c
@@gateway = Gateway.new
end
|
.time(msg) ⇒ Object
30
31
32
33
34
35
|
# File 'lib/exception_gateway.rb', line 30
def self.time(msg)
start_time = Time.now
yield_value = yield
end_time = Time.now
self.alert(msg, :time => "#{(end_time - start_time) * 1000} ms")
end
|
.transmit(exception) ⇒ Object
25
26
27
28
|
# File 'lib/exception_gateway.rb', line 25
def self.transmit(exception)
method = "#{@@config.backend}_transmit".to_s
@@gateway.send method, exception
end
|