Exception: Ipiranga::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ipiranga/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ Exception

Returns a new instance of Exception.



5
6
7
8
9
10
11
12
# File 'lib/ipiranga/error.rb', line 5

def initialize(error)
  if error.kind_of?(String)
    super(error)
  else
    @result = error
    super(error["msgErro"])
  end
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



3
4
5
# File 'lib/ipiranga/error.rb', line 3

def result
  @result
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/ipiranga/error.rb', line 14

def inspect
  "#{message}#{" - response: #{result.inspect}" unless result.nil?}"
end

#to_sObject



18
19
20
# File 'lib/ipiranga/error.rb', line 18

def to_s
  inspect
end