Class: Bullhorn
- Inherits:
-
Object
- Object
- Bullhorn
- Includes:
- Sender
- Defined in:
- lib/bullhorn.rb,
lib/bullhorn/plugin.rb,
lib/bullhorn/sender.rb,
lib/bullhorn/backtrace.rb
Defined Under Namespace
Modules: Plugin, Sender Classes: Backtrace
Constant Summary collapse
- LANGUAGE =
"ruby"
- CLIENT_NAME =
"bullhorn-ruby"
- VERSION =
"0.0.5"
- URL =
"http://www.bullhorn.it/api/v1/exception"
- FILTERING =
%(['"]?\[?%s\]?['"]?=>?([^&\s]*))
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#ignore_exceptions ⇒ Object
readonly
Returns the value of attribute ignore_exceptions.
-
#show_code_context ⇒ Object
readonly
Returns the value of attribute show_code_context.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Bullhorn
constructor
A new instance of Bullhorn.
Methods included from Sender
Constructor Details
#initialize(app, options = {}) ⇒ Bullhorn
Returns a new instance of Bullhorn.
29 30 31 32 33 34 35 36 |
# File 'lib/bullhorn.rb', line 29 def initialize(app, = {}) @app = app @api_key = [:api_key] || raise(ArgumentError, ":api_key is required") @filters = Array([:filters]) @url = [:url] || URL @ignore_exceptions = Array([:ignore_exceptions] || default_ignore_exceptions) @show_code_context = ([:show_code_context].nil? ? true : [:show_code_context]) end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
22 23 24 |
# File 'lib/bullhorn.rb', line 22 def api_key @api_key end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
21 22 23 |
# File 'lib/bullhorn.rb', line 21 def filters @filters end |
#ignore_exceptions ⇒ Object (readonly)
Returns the value of attribute ignore_exceptions.
24 25 26 |
# File 'lib/bullhorn.rb', line 24 def ignore_exceptions @ignore_exceptions end |
#show_code_context ⇒ Object (readonly)
Returns the value of attribute show_code_context.
25 26 27 |
# File 'lib/bullhorn.rb', line 25 def show_code_context @show_code_context end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
23 24 25 |
# File 'lib/bullhorn.rb', line 23 def url @url end |
Instance Method Details
#call(env) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bullhorn.rb', line 38 def call(env) status, headers, body = begin @app.call(env) rescue Exception => ex unless ignore_exceptions.include?(ex.class) notify ex, env end raise ex end [status, headers, body] end |