Exception: Shipvine::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ Error

Returns a new instance of Error.



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

def initialize(response = nil)
  if response.present?
    @code = response.code
    @shipvine_message = response.parsed_response["Errors"]["Error"]["Message"]
  end
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#shipvine_messageObject (readonly)

Returns the value of attribute shipvine_message.



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

def shipvine_message
  @shipvine_message
end