Class: Dreamcatcher::ExceptionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/dreamcatcher/exception_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, log_entries, context = {}) ⇒ ExceptionContext

Returns a new instance of ExceptionContext.



5
6
7
8
# File 'lib/dreamcatcher/exception_context.rb', line 5

def initialize(exception, log_entries, context = {})
  @exception, @log_entries, @context = exception, log_entries, context
  @timestamp = Time.now
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



3
4
5
# File 'lib/dreamcatcher/exception_context.rb', line 3

def context
  @context
end

#exceptionObject (readonly)

Returns the value of attribute exception.



3
4
5
# File 'lib/dreamcatcher/exception_context.rb', line 3

def exception
  @exception
end

#log_entriesObject (readonly)

Returns the value of attribute log_entries.



3
4
5
# File 'lib/dreamcatcher/exception_context.rb', line 3

def log_entries
  @log_entries
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/dreamcatcher/exception_context.rb', line 3

def timestamp
  @timestamp
end

Instance Method Details

#[](key) ⇒ Object



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

def [](key)
  @context[key]
end