Sha256: 59e428c4001cb7b951d563216d9230cc9248b1641ffcd0a71eb1389ddf91790d

Contents?: true

Size: 731 Bytes

Versions: 7

Compression:

Stored size: 731 Bytes

Contents

=begin
Agrid Quotes API



OpenAPI spec version: 1.0

Generated by: https://github.com/swagger-api/swagger-codegen.git


=end

module AgridClient
  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
        arg.each do |k, v|
          if k.to_s == 'message'
            super v
          else
            instance_variable_set "@#{k}", v
          end
        end
      else
        super arg
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
agrid-client-0.0.7 lib/agrid_client/api_error.rb
agrid-client-0.0.6 lib/agrid_client/api_error.rb
agrid-client-0.0.5 lib/agrid_client/api_error.rb
agrid-client-0.0.4 lib/agrid_client/api_error.rb
agrid-client-0.0.3 lib/agrid_client/api_error.rb
agrid-client-0.0.2 lib/agrid_client/api_error.rb
agrid-client-0.0.1 lib/agrid_client/api_error.rb