Class: Protein::ServiceError

Inherits:
Object
  • Object
show all
Defined in:
lib/protein/service_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pointerObject

Returns the value of attribute pointer.



4
5
6
# File 'lib/protein/service_error.rb', line 4

def pointer
  @pointer
end

#reasonObject (readonly)

Returns the value of attribute reason.



3
4
5
# File 'lib/protein/service_error.rb', line 3

def reason
  @reason
end