Class: ExceptionData

Inherits:
Object
  • Object
show all
Defined in:
lib/errorapp_notifier/exception_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ ExceptionData

Returns a new instance of ExceptionData.



4
5
6
# File 'lib/errorapp_notifier/exception_data.rb', line 4

def initialize(exception)
  @exception = exception
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



2
3
4
# File 'lib/errorapp_notifier/exception_data.rb', line 2

def exception
  @exception
end

Instance Method Details

#dataObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/errorapp_notifier/exception_data.rb', line 8

def data
  {
    :exception =>
    {
      :exception_class => exception.class.to_s,
      :message => exception.message,
      :backtrace => exception.backtrace,
      :occurred_at => Time.now.utc.iso8601
    }
  }
end