Class: ErrorStalker::Backend::InMemory
- Defined in:
- lib/error_stalker/backend/in_memory.rb
Overview
Provides an in-memory backend that stores all exception reports in an array. This is mostly useful for tests, and probably shouldn’t be used in real code.
Instance Attribute Summary collapse
-
#exceptions ⇒ Object
readonly
A list of exceptions stored in this backend.
Instance Method Summary collapse
-
#clear ⇒ Object
Clears the exception list.
-
#initialize ⇒ InMemory
constructor
Create a new instance of this backend, with an empty exception list.
-
#report(exception_report) ⇒ Object
Stores exception_report in the exceptions list.
Constructor Details
#initialize ⇒ InMemory
Create a new instance of this backend, with an empty exception list.
11 12 13 |
# File 'lib/error_stalker/backend/in_memory.rb', line 11 def initialize clear end |
Instance Attribute Details
#exceptions ⇒ Object (readonly)
A list of exceptions stored in this backend.
7 8 9 |
# File 'lib/error_stalker/backend/in_memory.rb', line 7 def exceptions @exceptions end |
Instance Method Details
#clear ⇒ Object
Clears the exception list. Pretty useful in a test setup
method!
21 22 23 |
# File 'lib/error_stalker/backend/in_memory.rb', line 21 def clear @exceptions = [] end |
#report(exception_report) ⇒ Object
Stores exception_report in the exceptions list.
16 17 18 |
# File 'lib/error_stalker/backend/in_memory.rb', line 16 def report(exception_report) @exceptions << exception_report end |