Exception: CorePro::CoreProApiException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/corepro/core_pro_api_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ CoreProApiException

Returns a new instance of CoreProApiException.



3
4
5
# File 'lib/corepro/core_pro_api_exception.rb', line 3

def initialize(errors)
  @errors = errors
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



7
8
9
# File 'lib/corepro/core_pro_api_exception.rb', line 7

def errors
  @errors
end

Instance Method Details

#firstCodeObject



13
14
15
# File 'lib/corepro/core_pro_api_exception.rb', line 13

def firstCode
  @errors[0].code
end

#firstMessageObject



9
10
11
# File 'lib/corepro/core_pro_api_exception.rb', line 9

def firstMessage
  @errors[0].message
end

#to_sObject



17
18
19
20
21
22
23
24
# File 'lib/corepro/core_pro_api_exception.rb', line 17

def to_s
  msg = ''
  @errors.each do |e|
    msg += e.to_s + ' '
  end
  msg

end