Class: Erorr::Notification
- Inherits:
-
Object
- Object
- Erorr::Notification
- Defined in:
- lib/erorr/notification.rb
Instance Method Summary collapse
-
#initialize(exception, params = {}) ⇒ Notification
constructor
A new instance of Notification.
- #to_params ⇒ Object
Constructor Details
#initialize(exception, params = {}) ⇒ Notification
Returns a new instance of Notification.
3 4 5 6 |
# File 'lib/erorr/notification.rb', line 3 def initialize(exception, params = {}) @exception = exception @params = params end |
Instance Method Details
#to_params ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/erorr/notification.rb', line 8 def to_params { class: @exception.class.name, message: @exception., location: location, backtrace: backtrace.join("\n"), environment: Erorr.config.env, timestamp: Time.current, fingerprint: fingerprint, host: Socket.gethostname, pid: Process.pid, request_params: @params.dig(:request, :params), request_remote_ip: @params.dig(:request, :remote_ip), request_headers: @params.dig(:request, :headers), } end |