Class: Protein::ServiceError
- Inherits:
-
Object
- Object
- Protein::ServiceError
- Defined in:
- lib/protein/service_error.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(reason: nil, pointer: nil) ⇒ ServiceError
constructor
A new instance of ServiceError.
Constructor Details
#initialize(reason: nil, pointer: nil) ⇒ ServiceError
6 7 8 9 10 11 12 13 |
# File 'lib/protein/service_error.rb', line 6 def initialize(reason: nil, pointer: nil) @reason = reason if reason @pointer = pointer if pointer unless @reason.is_a?(String) || @reason.is_a?(Symbol) raise(ProcessingError, "error reason must be a string or symbol") end end |
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
4 5 6 |
# File 'lib/protein/service_error.rb', line 4 def pointer @pointer end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
3 4 5 |
# File 'lib/protein/service_error.rb', line 3 def reason @reason end |