Sha256: 606b3493eec6e80c2d6daf806f8ffdee2e05babc4b8e4d62e6f2165456e2f40e

Contents?: true

Size: 944 Bytes

Versions: 324

Compression:

Stored size: 944 Bytes

Contents

=begin
#UltraCart Rest API V2

#UltraCart REST API Version 2

OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.15-SNAPSHOT

=end

module UltracartClient
  class ApiError < StandardError
    attr_reader :code, :response_headers, :response_body

    # Usage examples:
    #   ApiError.new
    #   ApiError.new("message")
    #   ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
    #   ApiError.new(:code => 404, :message => "Not Found")
    def initialize(arg = nil)
      if arg.is_a? Hash
        if arg.key?(:message) || arg.key?('message')
          super(arg[:message] || arg['message'])
        else
          super arg
        end

        arg.each do |k, v|
          instance_variable_set "@#{k}", v
        end
      else
        super arg
      end
    end
  end
end

Version data entries

324 entries across 324 versions & 1 rubygems

Version Path
ultracart_api-3.10.150 lib/ultracart_api/api_error.rb
ultracart_api-3.10.149 lib/ultracart_api/api_error.rb
ultracart_api-3.10.148 lib/ultracart_api/api_error.rb
ultracart_api-3.10.147 lib/ultracart_api/api_error.rb
ultracart_api-3.10.146 lib/ultracart_api/api_error.rb
ultracart_api-3.10.145 lib/ultracart_api/api_error.rb
ultracart_api-3.10.144 lib/ultracart_api/api_error.rb
ultracart_api-3.10.143 lib/ultracart_api/api_error.rb
ultracart_api-3.10.142 lib/ultracart_api/api_error.rb
ultracart_api-3.10.141 lib/ultracart_api/api_error.rb
ultracart_api-3.10.140 lib/ultracart_api/api_error.rb
ultracart_api-3.10.139 lib/ultracart_api/api_error.rb
ultracart_api-3.10.138 lib/ultracart_api/api_error.rb
ultracart_api-3.10.137 lib/ultracart_api/api_error.rb
ultracart_api-3.10.136 lib/ultracart_api/api_error.rb
ultracart_api-3.10.135 lib/ultracart_api/api_error.rb
ultracart_api-3.10.134 lib/ultracart_api/api_error.rb
ultracart_api-3.10.133 lib/ultracart_api/api_error.rb
ultracart_api-3.10.132 lib/ultracart_api/api_error.rb
ultracart_api-3.10.131 lib/ultracart_api/api_error.rb