class Intercom::IntercomError
Base class exception from which all public Intercom
exceptions will be derived
Attributes
application_error_code[R]
field[R]
http_code[R]
request_id[R]
Public Class Methods
new(message, context={})
click to toggle source
Calls superclass method
# File lib/intercom/errors.rb, line 6 def initialize(message, context={}) @http_code = context[:http_code] @application_error_code = context[:application_error_code] @field = context[:field] @request_id = context[:request_id] super(message) end
Public Instance Methods
inspect()
click to toggle source
# File lib/intercom/errors.rb, line 13 def inspect attributes = instance_variables.map do |var| value = instance_variable_get(var).inspect "#{var}=#{value}" end "##{self.class.name}:#{message} #{attributes.join(' ')}" end
to_hash()
click to toggle source
# File lib/intercom/errors.rb, line 20 def to_hash {message: message} .merge(Hash[instance_variables.map{ |var| [var[1..-1], instance_variable_get(var)] }]) end