class ProtoPharm::Response::ExceptionValue

Attributes

exception[R]

Public Class Methods

new(exception) click to toggle source
# File lib/proto_pharm/response.rb, line 8
def initialize(exception)
  @exception = case exception
               when String
                 StandardError.new(exception)
               when Class
                 exception.new("Exception from ProtoPharm")
               when Exception
                 exception
               else
                 raise ArgumentError.new(message: "Invalid exception class: #{exception.class}")
               end
end

Public Instance Methods

evaluate(_request = nil) click to toggle source
# File lib/proto_pharm/response.rb, line 21
def evaluate(_request = nil)
  raise @exception.dup
end