Class: MetaInspector::ExceptionLog
- Inherits:
-
Object
- Object
- MetaInspector::ExceptionLog
- Defined in:
- lib/meta_inspector/exception_log.rb
Overview
Stores the exceptions passed to it, warning about them if required
Instance Attribute Summary collapse
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#warn_level ⇒ Object
readonly
Returns the value of attribute warn_level.
Instance Method Summary collapse
- #<<(exception) ⇒ Object
-
#initialize(options = {}) ⇒ ExceptionLog
constructor
A new instance of ExceptionLog.
- #ok? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ ExceptionLog
9 10 11 12 |
# File 'lib/meta_inspector/exception_log.rb', line 9 def initialize( = {}) @exceptions = [] @warn_level = [:warn_level] end |
Instance Attribute Details
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
7 8 9 |
# File 'lib/meta_inspector/exception_log.rb', line 7 def exceptions @exceptions end |
#warn_level ⇒ Object (readonly)
Returns the value of attribute warn_level.
7 8 9 |
# File 'lib/meta_inspector/exception_log.rb', line 7 def warn_level @warn_level end |
Instance Method Details
#<<(exception) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/meta_inspector/exception_log.rb', line 14 def <<(exception) case warn_level when :warn warn exception when :raise raise exception end @exceptions << exception end |
#ok? ⇒ Boolean
25 26 27 |
# File 'lib/meta_inspector/exception_log.rb', line 25 def ok? exceptions.empty? end |