Sha256: f9a367066601ad36af536974afbe2ed378dcc8815180f6daed16d1239bf1a485
Contents?: true
Size: 658 Bytes
Versions: 18
Compression:
Stored size: 658 Bytes
Contents
module Agx class Error < StandardError attr_reader :title, :detail, :body, :raw_body, :status_code def initialize(message = "", params = {}) @title = params[:title] @detail = message @body = params[:body] @raw_body = params[:raw_body] @status_code = params[:status_code] super(message) end def to_s super + " " + instance_variables_to_s end private def instance_variables_to_s [:title, :detail, :body, :raw_body, :status_code].map do |attr| attr_value = send(attr) "@#{attr}=#{attr_value.inspect}" end.join(", ") end end end
Version data entries
18 entries across 18 versions & 1 rubygems