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.220 lib/ultracart_api/api_error.rb
ultracart_api-3.10.219 lib/ultracart_api/api_error.rb
ultracart_api-3.10.218 lib/ultracart_api/api_error.rb
ultracart_api-3.10.217 lib/ultracart_api/api_error.rb
ultracart_api-3.10.216 lib/ultracart_api/api_error.rb
ultracart_api-3.10.215 lib/ultracart_api/api_error.rb
ultracart_api-3.10.214 lib/ultracart_api/api_error.rb
ultracart_api-3.10.213 lib/ultracart_api/api_error.rb
ultracart_api-3.10.212 lib/ultracart_api/api_error.rb
ultracart_api-3.10.211 lib/ultracart_api/api_error.rb
ultracart_api-3.10.210 lib/ultracart_api/api_error.rb
ultracart_api-3.10.209 lib/ultracart_api/api_error.rb
ultracart_api-3.10.208 lib/ultracart_api/api_error.rb
ultracart_api-3.10.207 lib/ultracart_api/api_error.rb
ultracart_api-3.10.197 lib/ultracart_api/api_error.rb
ultracart_api-3.10.196 lib/ultracart_api/api_error.rb
ultracart_api-3.10.195 lib/ultracart_api/api_error.rb
ultracart_api-3.10.194 lib/ultracart_api/api_error.rb
ultracart_api-3.10.193 lib/ultracart_api/api_error.rb
ultracart_api-3.10.192 lib/ultracart_api/api_error.rb