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.5.1 lib/ultracart_api/api_error.rb
ultracart_api-3.5.0 lib/ultracart_api/api_error.rb
ultracart_api-3.4.13 lib/ultracart_api/api_error.rb
ultracart_api-3.4.12 lib/ultracart_api/api_error.rb
ultracart_api-3.4.11 lib/ultracart_api/api_error.rb
ultracart_api-3.4.10 lib/ultracart_api/api_error.rb
ultracart_api-3.4.9 lib/ultracart_api/api_error.rb
ultracart_api-3.4.8 lib/ultracart_api/api_error.rb
ultracart_api-3.4.7 lib/ultracart_api/api_error.rb
ultracart_api-3.4.6 lib/ultracart_api/api_error.rb
ultracart_api-3.4.5 lib/ultracart_api/api_error.rb
ultracart_api-3.4.4 lib/ultracart_api/api_error.rb
ultracart_api-3.4.3 lib/ultracart_api/api_error.rb
ultracart_api-3.4.2 lib/ultracart_api/api_error.rb
ultracart_api-3.4.1 lib/ultracart_api/api_error.rb
ultracart_api-3.4.0 lib/ultracart_api/api_error.rb
ultracart_api-3.3.2 lib/ultracart_api/api_error.rb
ultracart_api-3.3.1 lib/ultracart_api/api_error.rb
ultracart_api-3.3.0 lib/ultracart_api/api_error.rb
ultracart_api-3.2.15 lib/ultracart_api/api_error.rb