Sha256: 41aa9c89eb3fc81f1f6a32b45710e92f376174a6912e2321c3c27f237e8fab54
Contents?: true
Size: 615 Bytes
Versions: 20
Compression:
Stored size: 615 Bytes
Contents
module Eligible class EligibleError < StandardError attr_reader :message attr_reader :http_status attr_reader :http_body attr_reader :json_body attr_reader :errors def initialize(message = nil, http_status = nil, http_body = nil, json_body = nil) @message = message @http_status = http_status @http_body = http_body @json_body = json_body @errors = (@json_body || {}).fetch(:errors, []) end def to_s status_string = @http_status.nil? ? '' : "(Status #{@http_status}) " "#{status_string}#{@message}: #{@errors.to_json}" end end end
Version data entries
20 entries across 20 versions & 1 rubygems