Sha256: 2e301ed6989e28c3c38d9d6079ad7318ed556b10c2333166d77d8fa2e89a8dfc

Contents?: true

Size: 304 Bytes

Versions: 6

Compression:

Stored size: 304 Bytes

Contents

module LinkshareAPI
  class Error < StandardError
    attr_reader :message, :code

    def initialize(message = nil, code = nil)
      @message = message
      @code    = code
    end

    def to_s
      code_string = code.nil? ? "" : " (Code #{code})"
      "#{message}#{code_string}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
linkshare_api-0.3.2 lib/linkshare_api/errors/error.rb
linkshare_api-0.3.1 lib/linkshare_api/errors/error.rb
linkshare_api-0.3.0 lib/linkshare_api/errors/error.rb
linkshare_api-0.2.0 lib/linkshare_api/errors/error.rb
linkshare_api-0.1.0 lib/linkshare_api/errors/error.rb
linkshare_api-0.0.1 lib/linkshare_api/errors/error.rb