Exception: BaseCRM::ErrorsCollection

Inherits:
StandardError
  • Object
show all
Defined in:
lib/basecrm/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors, meta) ⇒ ErrorsCollection

Returns a new instance of ErrorsCollection.



53
54
55
56
57
58
# File 'lib/basecrm/errors.rb', line 53

def initialize(errors, meta)
  @errors = errors

  @http_status = meta[:http_status]
  @logref = meta[:logref]
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



47
48
49
# File 'lib/basecrm/errors.rb', line 47

def errors
  @errors
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



49
50
51
# File 'lib/basecrm/errors.rb', line 49

def http_status
  @http_status
end

#logrefObject (readonly) Also known as: request_id

Returns the value of attribute logref.



49
50
51
# File 'lib/basecrm/errors.rb', line 49

def logref
  @logref
end

Instance Method Details

#to_sObject



60
61
62
63
# File 'lib/basecrm/errors.rb', line 60

def to_s
  status = "[#{@logref}] http_status=#{@http_status}\n"
  status + @errors.map(&:to_s).join("\n")
end